# V alert dialog 14

> Clear All Data with checkbox consent gate

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

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

## Install

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

## Files

### `registry/default/variants/v-alert-dialog-14.tsx`

```tsx
"use client";

import { Trash2Icon } from "lucide-react";
import { useState } from "react";
import {
  AlertDialog,
  AlertDialogClose,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogTitle,
  AlertDialogTrigger,
} from "@/registry/default/ui/alert-dialog";
import { Button } from "@/registry/default/ui/button";
import { Checkbox } from "@/registry/default/ui/checkbox";
import { Label } from "@/registry/default/ui/label";

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

  return (
    <AlertDialog onOpenChange={(open) => !open && setAgreed(false)}>
      <AlertDialogTrigger
        render={<Button variant="destructive">Clear All Data</Button>}
      />
      <AlertDialogContent className="sm:max-w-sm">
        <div className="flex flex-col items-center gap-3 p-6 pb-4">
          <div className="flex size-12 items-center justify-center rounded-full bg-destructive/10">
            <Trash2Icon className="size-5 text-destructive" />
          </div>
          <AlertDialogTitle className="text-center font-semibold">
            Clear all workspace data?
          </AlertDialogTitle>
          <AlertDialogDescription className="text-center text-muted-foreground text-sm">
            This permanently deletes all projects, files, members, and settings.
            This action is irreversible and cannot be undone.
          </AlertDialogDescription>
        </div>
        <div className="mx-6 mb-4 flex items-start gap-2 rounded-lg border border-destructive/20 bg-destructive/5 p-3">
          <Checkbox
            checked={agreed}
            id="clear-confirm"
            onCheckedChange={(v) => setAgreed(Boolean(v))}
          />
          <Label
            className="cursor-pointer text-muted-foreground text-sm leading-snug"
            htmlFor="clear-confirm"
          >
            I understand this will permanently delete all data and cannot be
            recovered.
          </Label>
        </div>
        <AlertDialogFooter>
          <AlertDialogClose render={<Button variant="ghost" />}>
            Cancel
          </AlertDialogClose>
          <AlertDialogClose
            render={<Button disabled={!agreed} variant="destructive" />}
          >
            Delete Everything
          </AlertDialogClose>
        </AlertDialogFooter>
      </AlertDialogContent>
    </AlertDialog>
  );
}
```
