Checkbox
Controlled checkbox built on Radix. Supports indeterminate, inline label and description.
Examples
With inline label
Required to continue.
<Checkboxlabel="Accept terms"description="Required to continue."checked={checked}onCheckedChange={(v) => setChecked(Boolean(v))}/>
Group
<Checkbox label="Email notifications" defaultChecked /><Checkbox label="SMS notifications" /><Checkbox label="Push notifications" defaultChecked />
Indeterminate
<Checkbox label="Select all" checked="indeterminate" />
Disabled
<Checkbox label="Off & disabled" disabled /><Checkbox label="On & disabled" checked disabled />
API Reference
Props of the Checkbox component.
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | 'indeterminate' | — | — |
defaultChecked | boolean | — | — |
onCheckedChange | (checked: boolean | 'indeterminate') => void | — | — |
label | string | — | Renders the label inline next to the checkbox. |
description | string | — | Helper text below the label. |
disabled | boolean | false | — |