Checkbox
A control that allows the user to toggle between checked and not checked.
Default
Pair with a Label so the text is also a click target.
Installation
CLI
Also needs
npm i lucide-reactUsage
checkbox.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean · "indeterminate" | — | Controlled checked state. |
| defaultChecked | boolean · "indeterminate" | — | Uncontrolled initial checked state. |
| onCheckedChange | (checked: boolean · "indeterminate") => void | — | Called when the checked state changes. |
| disabled | boolean | false | Prevents interaction and dims the control. |
| aria-invalid | boolean | — | Shows the invalid (destructive) border. |