Forms
Navigation & layout
Data display & feedback
Date & time
Browse components
← All components
Checkbox Group
Group of checkboxes that share a value array.
Install
npx shadcn@latest add https://ui.anuragroy.dev/r/checkbox-group.jsonPreview
Loading preview…
Installation
Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.
Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/checkbox-group.jsonGitHub fallback if the website is down:
Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/checkbox-group.jsonUsage
Import paths follow your components.json aliases. After install, the default path is @/components/ui/checkbox-group.
Import
import { CheckboxGroup } from "@/components/ui/checkbox-group"example.tsx
import { Checkbox } from "@/components/ui/checkbox"import { CheckboxGroup } from "@/components/ui/checkbox-group"export function Example() { return ( <CheckboxGroup defaultValue={["a"]} className="flex flex-col gap-2"> <label className="flex items-center gap-2 text-sm"> <Checkbox value="a" /> Alpha </label> <label className="flex items-center gap-2 text-sm"> <Checkbox value="b" /> Beta </label> </CheckboxGroup> )}API Reference
CheckboxGroup
Base UI CheckboxGroup. Value is `string[]`.
| Prop | Type | Default |
|---|---|---|
| value | string[] | — |
| defaultValue | string[] | — |
| onValueChange | (value: string[]) => void | — |