# V switch 14

> Required Agreement Switch

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

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

```tsx
"use client";

import { useState } from "react";
import { Button } from "@/registry/default/ui/button";
import {
  Field,
  FieldDescription,
  FieldLabel,
} from "@/registry/default/ui/field";
import { Input } from "@/registry/default/ui/input";
import { Switch } from "@/registry/default/ui/switch";

export default function Particle() {
  const [agreed, setAgreed] = useState(false);

  return (
    <form
      className="w-full max-w-sm space-y-4 rounded-xl border p-5"
      onSubmit={(e) => e.preventDefault()}
    >
      <p className="font-semibold">Create Account</p>
      <Field>
        <FieldLabel>Full name</FieldLabel>
        <Input placeholder="Jane Smith" type="text" />
      </Field>
      <Field>
        <FieldLabel>Email</FieldLabel>
        <Input placeholder="jane@example.com" type="email" />
      </Field>
      <Field className="flex-row items-start gap-3">
        <Switch
          checked={agreed}
          className="mt-0.5"
          onCheckedChange={setAgreed}
          required
        />
        <div>
          <FieldLabel>Terms &amp; Conditions</FieldLabel>
          <FieldDescription>
            I agree to the Terms of Service and Privacy Policy
          </FieldDescription>
        </div>
      </Field>
      <Button className="w-full" disabled={!agreed} type="submit">
        Create Account
      </Button>
    </form>
  );
}
```
