Checkbox

Form

Selects one or more items from a group, or confirms a choice.

npx shadcn@latest add checkbox

Default

Preview
Live
tsx
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.

PropTypeDescription
checkedboolean | "indeterminate"Controlled checked state.
onCheckedChange(checked: boolean) => voidCalled when the checkbox toggles.