# V switch 15

> Do Not Disturb Mode

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

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

```tsx
"use client";

import { BellOffIcon, MoonIcon } from "lucide-react";
import { useState } from "react";
import { Switch } from "@/registry/default/ui/switch";

const scheduleOptions = ["1 hour", "2 hours", "4 hours", "Until tomorrow"];

export default function Particle() {
  const [dnd, setDnd] = useState(false);
  const [selected, setSelected] = useState("1 hour");

  return (
    <div className="w-full max-w-sm space-y-4 rounded-xl border p-5">
      <div className="flex items-center justify-between">
        <div className="flex items-center gap-2">
          <div
            className={`flex size-9 items-center justify-center rounded-lg transition-colors ${dnd ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"}`}
          >
            {dnd ? (
              <BellOffIcon aria-hidden="true" className="size-4" />
            ) : (
              <MoonIcon aria-hidden="true" className="size-4" />
            )}
          </div>
          <div>
            <p className="font-medium text-sm">Do Not Disturb</p>
            <p className="text-muted-foreground text-xs">
              {dnd ? `Active for ${selected}` : "All notifications enabled"}
            </p>
          </div>
        </div>
        <Switch checked={dnd} onCheckedChange={setDnd} />
      </div>

      {dnd && (
        <div className="space-y-2">
          <p className="font-medium text-muted-foreground text-xs uppercase tracking-wide">
            Duration
          </p>
          <div className="grid grid-cols-2 gap-2">
            {scheduleOptions.map((opt) => (
              <button
                className={`rounded-lg border px-3 py-2 font-medium text-xs transition-colors ${
                  selected === opt
                    ? "border-primary bg-primary/5 text-primary"
                    : "hover:bg-muted"
                }`}
                key={opt}
                onClick={() => setSelected(opt)}
                type="button"
              >
                {opt}
              </button>
            ))}
          </div>
        </div>
      )}
    </div>
  );
}
```
