Getting Started
Foundations
Components
Checkbox Group
A group component for managing multiple checkboxes with shared state. Supports controlled and uncontrolled usage.
#Installation
npx @dinachi/cli@latest add checkbox-group#Usage
tsx
import { CheckboxGroup } from '@/components/ui/checkbox-group'#Examples
Default Checkbox Group
A basic checkbox group with multiple options
Controlled Checkbox Group
Checkbox group with controlled state and live value display
Selected: react
Horizontal Checkbox Group
Checkbox group with horizontal layout
Disabled Checkbox Group
Checkbox group in disabled state
#API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string[] | — | The controlled value of the checkbox group |
| defaultValue | string[] | [] | The default value when uncontrolled |
| onValueChange | (value: string[]) => void | — | Callback fired when the group value changes |
| disabled | boolean | false | Whether the entire checkbox group is disabled |
| required | boolean | false | Whether at least one checkbox must be checked |