Checkbox
Binary input. Supports checked, unchecked, and indeterminate states via modelValue.
Basic
A checkbox paired with a Label so the text is a click target too.
Usage
Import the parts you need from the component's folder.
ts
import { Checkbox } from "@/components/ui/checkbox";With description
Wrap the label and a FieldDescription in FieldContent for a helper line.
Disabled
Use the disabled prop to disable the checkbox.
Invalid
Set aria-invalid on the Checkbox and pair it with a FieldError for validation.
Group
Stack several checkboxes in a FieldSet, each bound to its own ref.
Select all
A header checkbox goes indeterminate when only some rows are selected.
API Reference
Checkbox
Accessibility
Keyboard shortcuts and ARIA behavior.
- Uses role=checkbox with aria-checked reflecting the state.
- Supports an indeterminate (mixed) state via aria-checked="mixed".
- Pair with a label so the control's purpose is announced.