Skip to content

Checkbox

A binary choice with a precise, legible state.

FieldForm
npx shadcn@latest add @silicon-ui/checkbox

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

    • components/silicon-ui/checkbox/checkbox.tsx
    • components/silicon-ui/checkbox/checkbox.module.css
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
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