Documentation
Getting Started
Foundations
Form
Layout
Display
Navigation
Overlay
Feedback
Checkbox Group
Form
A group component that manages multiple checkboxes with shared state and validation. Perfect for multi-select forms and preference settings.
Installation
bash
1npx @dinachi/cli@latest add checkbox-groupRun the CLI command above to automatically install the component and its dependencies.
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 currently selected values |
defaultValue | string[] | [] | The default selected values |
onValueChange | (value: string[]) => void | — | Callback fired when the selected values change |
disabled | boolean | false | Whether the checkbox group is disabled |
required | boolean | false | Whether at least one checkbox must be selected |