Skip to content

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.json

Preview

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.json

GitHub 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.json

Usage

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[]`.

PropTypeDefault
valuestring[]—
defaultValuestring[]—
onValueChange(value: string[]) => void—