āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/sadmann7/diceui/components/checkbox-group ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
@diceui/checkbox-group
npx shadcn@latest add "https://diceui.com/r/checkbox-group"
```package-install
@diceui/checkbox-group
```
</Step>
<Step>
Copy and paste the following code into your project.
<ComponentSource name="checkbox-group" />
</Step>
</Steps>
Import the parts, and compose them together.
import * as CheckboxGroup from "@diceui/checkbox-group";
<CheckboxGroup.Root>
<CheckboxGroup.Label />
<CheckboxGroup.List>
<CheckboxGroup.Item>
<CheckboxGroup.Indicator />
</CheckboxGroup.Item>
</CheckboxGroup.List>
<CheckboxGroup.Description>
</CheckboxGroup.Root>
```ts
export default {
theme: {
extend: {
keyframes: {
"stroke-dashoffset": {
"0%": { strokeDashoffset: "100%" },
"100%": { strokeDashoffset: "0" },
},
},
animation: {
"stroke-dashoffset": "stroke-dashoffset 0.2s linear forwards",
},
},
},
}
```
</Step>
<Step>
Copy and paste the `CheckboxGroup.Indicator` block from the following example into your project.
<ComponentTabs name="checkbox-group-animated-demo" />
</Step>
</Steps>
Validate the group with onValidate or required prop. Can be used for native form validation.
Hold down the Shift key to select and deselect multiple checkboxes at once.
Container for the checkbox group.
<AutoTypeTable path="./types/docs/checkbox-group.ts" name="RootProps" />
<DataAttributesTable attributes={[ { title: "[data-invalid]", value: "Present when invalid.", }, { title: "[data-disabled]", value: "Present when disabled.", }, { title: "[data-orientation]", value: ["vertical", "horizontal"], }, ]} />
Label for the checkbox group.
<AutoTypeTable path="./types/docs/checkbox-group.ts" name="LabelProps" />
<DataAttributesTable attributes={[ { title: "[data-disabled]", value: "Present when disabled.", }, ]} />
Container for checkbox items.
<AutoTypeTable path="./types/docs/checkbox-group.ts" name="ListProps" />
<DataAttributesTable attributes={[ { title: "[data-orientation]", value: ["vertical", "horizontal"], }, { title: "[data-invalid]", value: "Present when invalid.", }, ]} />
Individual checkbox item.
<AutoTypeTable path="./types/docs/checkbox-group.ts" name="ItemProps" />
<DataAttributesTable attributes={[ { title: "[data-state]", value: ["checked", "unchecked"], }, { title: "[data-disabled]", value: "Present when disabled.", }, { title: "[data-invalid]", value: "Present when invalid.", }, { title: "[data-orientation]", value: ["vertical", "horizontal"], }, ]} />
Visual indicator for the checkbox state.
<AutoTypeTable path="./types/docs/checkbox-group.ts" name="IndicatorProps" />
<DataAttributesTable attributes={[ { title: "[data-state]", value: ["checked", "unchecked"], }, { title: "[data-disabled]", value: "Present when disabled.", }, ]} />
Optional description text for the checkbox group.
<AutoTypeTable path="./types/docs/checkbox-group.ts" name="DescriptionProps" />
<DataAttributesTable attributes={[ { title: "[data-disabled]", value: "Present when disabled.", }, { title: "[data-invalid]", value: "Present when invalid.", }, ]} />
Error or validation message for the checkbox group.
<AutoTypeTable path="./types/docs/checkbox-group.ts" name="MessageProps" />
<DataAttributesTable attributes={[ { title: "[data-disabled]", value: "Present when disabled.", }, { title: "[data-invalid]", value: "Present when invalid.", }, ]} />
<KeyboardShortcutsTable shortcuts={[ { keys: ["Space"], description: "Toggles checkbox item." }, ]} />
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā