Checkbox

A binary choice with a precise, legible state.

npx shadcn@latest add @silicon-ui/checkbox
fieldform
Loading…

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/checkbox

Manually

  1. Install the dependencies.

    npm install @radix-ui/react-checkbox motion
  2. Copy these files into your project. Shared files are skipped if you already have them.

    • components/silicon-ui/checkbox/checkbox.tsx
    • components/silicon-ui/checkbox/checkbox.module.css
  3. Install the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

Source codetsx
import { Checkbox } from "@/components/silicon-ui/checkbox/checkbox";

API reference

PropTypeDefault
labelstring—
descriptionstring—

Also accepts the props of ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>.

Dependencies

npm
@radix-ui/react-checkboxmotion
Registry
silicon-motion-tokens