Dinachi

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

PropTypeDefaultDescription
valuestring[]The controlled value of the checkbox group
defaultValuestring[][]The default value when uncontrolled
onValueChange(value: string[]) => voidCallback fired when the group value changes
disabledbooleanfalseWhether the entire checkbox group is disabled
requiredbooleanfalseWhether at least one checkbox must be checked