# V checkbox group 8

> Basic checkbox group

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/v-checkbox-group-8).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-checkbox-group-8
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-checkbox-group-8-light-7985d781f7d98698.png
- Registry item: https://ui.cnippet.dev/r/v-checkbox-group-8.json
- Categories: checkbox group
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-checkbox-group-8.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/checkbox-group`

## Files

### `registry/default/variants/v-checkbox-group-8.tsx`

```tsx
import { Checkbox } from "@/registry/default/ui/checkbox";
import { CheckboxGroup } from "@/registry/default/ui/checkbox-group";

const notifications = [
  {
    description: "Get notified when someone @mentions you.",
    id: "mentions",
    label: "Mentions",
  },
  {
    description: "Receive a summary of your team's activity.",
    id: "digest",
    label: "Weekly digest",
  },
  {
    description: "Security alerts and login notifications.",
    id: "security",
    label: "Security alerts",
  },
  {
    description: "Product updates and new feature announcements.",
    id: "product",
    label: "Product updates",
  },
];

export default function Component() {
  return (
    <CheckboxGroup
      aria-label="Notification preferences"
      className="gap-0 divide-y"
      defaultValue={["mentions", "security"]}
    >
      {notifications.map((item) => (
        <label
          className="flex cursor-pointer items-start gap-3 py-3 first:pt-0 last:pb-0"
          htmlFor={item.id}
          key={item.id}
        >
          <Checkbox className="mt-0.5" id={item.id} value={item.id} />
          <div className="flex flex-col gap-0.5">
            <span className="font-medium text-sm">{item.label}</span>
            <span className="text-muted-foreground text-xs">
              {item.description}
            </span>
          </div>
        </label>
      ))}
    </CheckboxGroup>
  );
}
```
