# V switch 5

> Switch list in card with icons

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

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-switch-5
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-switch-5-light-ee0d0f5bd5e0316f.png
- Registry item: https://ui.cnippet.dev/r/v-switch-5.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-5.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-5.tsx`

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

export function Pattern() {
  return (
    <div className="flex flex-col gap-4">
      <Field className="w-auto flex-row">
        <Switch
          className="data-checked:bg-blue-500"
          defaultChecked
          id="sw-blue"
        />
        <FieldLabel htmlFor="sw-blue">Blue</FieldLabel>
      </Field>
      <Field className="w-auto flex-row">
        <Switch
          className="data-checked:bg-green-500"
          defaultChecked
          id="sw-green"
        />
        <FieldLabel htmlFor="sw-green">Green</FieldLabel>
      </Field>
      <Field className="w-auto flex-row">
        <Switch
          className="data-checked:bg-yellow-500"
          defaultChecked
          id="sw-yellow"
        />
        <FieldLabel htmlFor="sw-yellow">Yellow</FieldLabel>
      </Field>
    </div>
  );
}
```
