Checkbox
FormSelects one or more items from a group, or confirms a choice.
npx shadcn@latest add checkboxDefault
Preview
Livetsx
1<div className="flex items-center gap-3">2 <Checkbox id="newsletter" defaultChecked />3 <Label htmlFor="newsletter">Subscribe to product updates</Label>4</div>
API reference
All props of the underlying Base UI primitive are forwarded. The table below documents the Shelf-specific props.
| Prop | Type | Description |
|---|---|---|
| checked | boolean | "indeterminate" | Controlled checked state. |
| onCheckedChange | (checked: boolean) => void | Called when the checkbox toggles. |