Components
Checkbox
Renders a checkbox input with support for checked, unchecked, and indeterminate states.
Usage
Best practices
A bare
Checkboxhas no label - pair it with aLabel(htmlFor) or useCheckboxField, which wiresid/htmlFor/aria-describedbyfor you.Set the mixed state via the
indeterminateprop;checkedstays a boolean.Controlled use needs
checked+onCheckedChangetogether; passing onlycheckedfreezes the box - usedefaultCheckedfor uncontrolled.For a selectable card or a label+description row, reach for
CheckboxCardGroup/CheckboxFieldinstead of hand-laying-out aroundCheckbox.
Props
Also exports
- type
CheckboxProps
Composition
Builds on
Used by