Getting Started
Foundations
Components
Checkbox
A checkbox component with support for checked, unchecked, and indeterminate states. Built with accessibility in mind.
#Installation
npx @dinachi/cli@latest add checkbox#Usage
tsx
import { Checkbox } from '@/components/ui/checkbox'#Examples
Default Checkbox
A basic checkbox with label
Checkbox States
Different checkbox states including indeterminate
#API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | 'indeterminate' | — | The controlled checked state of the checkbox |
| defaultChecked | boolean | false | The default checked state when uncontrolled |
| onCheckedChange | (checked: boolean | 'indeterminate') => void | — | Callback fired when the checked state changes |
| disabled | boolean | false | Whether the checkbox is disabled |
| required | boolean | false | Whether the checkbox is required |