# Settings group

> A grouped list of notification settings, each row with a label, helper text, and a switch.

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

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

## Install

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

## Files

### `registry/patterns/switch/switch-08.tsx`

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

const settings = [
  {
    id: 'marketing',
    label: 'Marketing emails',
    description: 'Product updates, tips, and announcements.',
    defaultChecked: true,
  },
  {
    id: 'security',
    label: 'Security alerts',
    description: 'Sign-in notifications and password changes.',
    defaultChecked: true,
  },
  {
    id: 'digest',
    label: 'Weekly digest',
    description: 'A summary of your team activity every Monday.',
    defaultChecked: false,
  },
]

export function Switch08() {
  return (
    <FieldSet className="max-w-sm">
      <FieldLegend>Notifications</FieldLegend>
      <FieldDescription>Choose how we reach you.</FieldDescription>
      <FieldGroup className="gap-4">
        {settings.map((item) => (
          <Field key={item.id} orientation="horizontal">
            <FieldContent>
              <FieldLabel htmlFor={`switch-08-${item.id}`}>
                {item.label}
              </FieldLabel>
              <FieldDescription>{item.description}</FieldDescription>
            </FieldContent>
            <Switch
              id={`switch-08-${item.id}`}
              defaultChecked={item.defaultChecked}
            />
          </Field>
        ))}
      </FieldGroup>
    </FieldSet>
  )
}
```
