Checkbox
Checkbox is a user interface control that enables users to toggle between checked, unchecked, and indeterminate states
Usage
You can control the checkbox state using the checked
and onCheckedChange
props:
Checkbox Props
Prop | Type | Default |
---|---|---|
checked | boolean | "indeterminate" | - |
defaultChecked | boolean | "indeterminate" | - |
onCheckedChange | (checked: boolean | "indeterminate") => void | - |
disabled | boolean | - |
Examples
States
The Checkbox component supports multiple states to represent different selection conditions:
- Unchecked: Default state
- Checked: Selected state
- Indeterminate: Partial selection state
- Disabled: Disabled state