Checkbox
A toggle for a single boolean value. Built on base-ui Checkbox — focus management, keyboard support, and ARIA wiring come for free.
Checkbox renders only the box. Give it an id and pair it with a FieldLabel (inside a Field) or a Label so the label text is clickable and the control is announced. See Field for the layout primitives.
With a label
Wrap the box and its label in a Field orientation="horizontal", and connect them with id / htmlFor. Clicking the label toggles the box.
Checked by default
Checkbox is uncontrolled by default — pass defaultChecked to start it on. To drive the value yourself, pass checked together with onCheckedChange (which receives the next boolean directly).
Disabled
disabled dims the control and blocks interaction. It works with both the unchecked and checked states.
Indeterminate
indeterminate renders a minus glyph instead of a check — the third “partially selected” state used for a parent that controls a group. It is purely visual; track the real value yourself and clear it once the user commits a choice.
Group / list
For a list of options, render one Checkbox per item and keep the selection in state. Wrapping each row in a Label makes the whole row a click target; data-checked lets you highlight the selected rows.
Reference
Checkbox
Extends base-ui Checkbox.Root props (minus onChange).
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | Controlled checked state |
defaultChecked | boolean | false | Initial checked state (uncontrolled) |
onCheckedChange | (checked: boolean) => void | — | Fires when the state changes; receives the next boolean directly |
indeterminate | boolean | false | Renders the partial-selection (minus) glyph; visual only |
disabled | boolean | false | Dims the control and blocks interaction |
id | string | — | Connects the box to a FieldLabel / Label via htmlFor |
name | string | — | Field name when submitted as part of a native form |
value | string | — | Submitted value when checked |
required | boolean | false | Marks the field as required in a form |
className | string | — | Merged onto the box |