Checkbox
Checked, unchecked, and indeterminate states.
Installation
Usage
Examples
Form integration
Name, value and required wire the checkbox into native form submission and validation.
Disabled
Disabled checkboxes ignore interaction and render dimmed.
With description
Pair the label with helper text for longer explanations.
API reference
Checkbox
| Prop | Type | Default |
|---|---|---|
checkedControlled checked state. Use with onCheckedChange. | boolean | - |
defaultCheckedInitially checked when uncontrolled. | boolean | false |
onCheckedChangeCalled when the checkbox is ticked or unticked. | (checked: boolean) => void | - |
disabledIgnore user interaction. Renders at half opacity. | boolean | false |
indeterminateMixed state: neither ticked nor unticked. Pair with checked={false}. | boolean | false |
readOnlyShow state without allowing tick or untick. | boolean | false |
requiredRequire the checkbox to be ticked before form submit. | boolean | false |
nameIdentifies the field when the form is submitted. | string | - |
valueValue submitted with the form when ticked. | string | - |
renderPolymorphic render prop. Use to render a custom element. | ReactElement | ((props) => ReactNode) | - |
classNameAdditional classes merged with the default checkbox styles. | string | - |