# V switch 4

> Switch group

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

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

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-switch-4.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/switch`

## Files

### `registry/default/variants/v-switch-4.tsx`

```tsx
import { Field, FieldLabel } from "@/registry/default/ui/field";
import { Switch } from "@/registry/default/ui/switch";

export function Pattern() {
  return (
    <Field className="w-auto space-y-2">
      <FieldLabel>Notification Settings</FieldLabel>
      <Field className="flex-row">
        <Switch defaultChecked id="sg-email" />
        <FieldLabel htmlFor="sg-email">Email notifications</FieldLabel>
      </Field>
      <Field className="flex-row">
        <Switch id="sg-sms" />
        <FieldLabel htmlFor="sg-sms">SMS notifications</FieldLabel>
      </Field>
      <Field className="flex-row">
        <Switch defaultChecked id="sg-push" />
        <FieldLabel htmlFor="sg-push">Push notifications</FieldLabel>
      </Field>
    </Field>
  );
}
```
