# Group

> Grouped list of notification checkboxes, each with a label and helper description, inside a labelled fieldset.

A shadcn/ui block from the [@flx](https://ui.flexnative.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/flx/checkbox-04).

- Page, with a live preview: https://shadcn.exchange/r/flx/checkbox-04
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/flx/checkbox-04-light-14133ed3c7d360f7.png
- Registry item: https://ui.flexnative.com/r/checkbox-04.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.flexnative.com/r/checkbox-04.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: `checkbox`, `field`

## Files

### `registry/patterns/checkbox/checkbox-04.tsx`

```tsx
import { Checkbox } from '@/components/ui/checkbox'
import {
  Field,
  FieldContent,
  FieldDescription,
  FieldGroup,
  FieldLabel,
  FieldLegend,
  FieldSet,
} from '@/components/ui/field'

const notifications = [
  {
    id: 'comments',
    label: 'Comments',
    description: 'Someone comments on your posts.',
    defaultChecked: true,
  },
  {
    id: 'mentions',
    label: 'Mentions',
    description: 'Someone @mentions you in a thread.',
    defaultChecked: true,
  },
  {
    id: 'follows',
    label: 'New followers',
    description: 'Someone starts following your account.',
    defaultChecked: false,
  },
]

export function Checkbox04() {
  return (
    <FieldSet className="max-w-sm">
      <FieldLegend>Email notifications</FieldLegend>
      <FieldDescription>
        Choose what you want to be notified about.
      </FieldDescription>
      <FieldGroup data-slot="checkbox-group">
        {notifications.map((item) => (
          <Field key={item.id} orientation="horizontal">
            <Checkbox id={`checkbox-04-${item.id}`} defaultChecked={item.defaultChecked} />
            <FieldContent>
              <FieldLabel htmlFor={`checkbox-04-${item.id}`}>
                {item.label}
              </FieldLabel>
              <FieldDescription>{item.description}</FieldDescription>
            </FieldContent>
          </Field>
        ))}
      </FieldGroup>
    </FieldSet>
  )
}
```
