Checkbox
A checkbox component with neumorphic styling, built on top of Base UI.
Installation
$ npx shadcn@latest add "/r/checkbox.json"
Usage
With Label
Disabled State
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "sm" | "md" | "lg" | "md" | The size of the checkbox. |
| checked | boolean | - | The controlled checked state of the checkbox. |
| defaultChecked | boolean | - | The default checked state when uncontrolled. |
| onCheckedChange | (checked: boolean) => void | - | Event handler called when the checked state changes. |
| indeterminate | boolean | - | Whether the checkbox is in an indeterminate state. |
| disabled | boolean | false | Whether the checkbox is disabled. |
| className | string | - | Additional CSS classes to apply to the checkbox. |