# AlertDialog

> A blocking confirmation for irreversible or costly actions; same motion and surface as **Dialog**, no close ×, no click-outside dismissal.

## Facts

- **Product**: Max
- **Family**: Overlays
- **Global**: `window.DigitalCrew.AlertDialog`
- **Source**: `max-agent: src/components/ui/alert-dialog.tsx`
- **Import in the app**: `import { AlertDialog } from "@/components/ui/alert-dialog";`
- **Live preview**: /design/components/alert-dialog/preview.html
- **Page**: /design/components/alert-dialog

## Guidelines

**Use it for** deleting, disconnecting, sending to many people, spending credits. In app code prefer `useConfirm()` from [**ConfirmDialogProvider**](/design/components/confirm-dialog-provider.md), which wraps this with the destructive treatment and a loading state; the Max audit still counts 14 `window.confirm` calls to replace.

**What you provide**: a title that names the object ("Delete “Q4 fintech outreach”?"), a description that states the consequence in numbers, a cancel that names what stays ("Keep campaign") and an action that repeats the verb ("Delete campaign") — destructive actions in `destructive`.

## API

```ts
declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): any;
declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): any;
declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): any;
declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): any;
declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): any;
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): any;
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): any;
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): any;
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): any;
declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>): any;
declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): any;
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
```

## Example

```html
<div id="root" class="p-6"></div>
<script>
(function () {
  var h = React.createElement, DC = window.DigitalCrew, I = DC.Icons;
function App() {
  return h(DC.AlertDialog, { defaultOpen: true },
    h(DC.AlertDialogTrigger, { asChild: true }, h(DC.Button, { variant: "destructive" }, "Delete campaign")),
    h(DC.AlertDialogContent, { onOpenAutoFocus: function (e) { e.preventDefault(); } },
      h(DC.AlertDialogHeader, null,
        h(DC.AlertDialogTitle, null, "Delete “Q4 fintech outreach”?"),
        h(DC.AlertDialogDescription, null, "Its 3 scheduled steps stop and 214 prospects leave the sequence. Replies stay in Unibox.")),
      h(DC.AlertDialogFooter, null,
        h(DC.AlertDialogCancel, null, "Keep campaign"),
        h(DC.AlertDialogAction, { className: "bg-destructive text-white hover:bg-destructive/90" }, "Delete campaign"))));
}
  ReactDOM.createRoot(document.getElementById("root")).render(h(DC.TooltipProvider, { delayDuration: 80 }, h(App)));
})();
</script>
```

## More in Overlays

- [Command](/design/components/command.md): A keyboard-first search-and-act list (cmdk); the ⌘K menu and the core of every searchable picker.
- [ConfirmDialogProvider](/design/components/confirm-dialog-provider.md): App-wide confirmations through one hook: wrap the app in `ConfirmDialogProvider`, then call `useConfirm().confirm({...})` anywhere.
- [Dialog](/design/components/dialog.md): A modal for focused tasks that need an answer before going on; opens in 250ms from 96% scale and closes in 150ms (`.t-modal`).
- [DiscardChangesDialog](/design/components/discard-changes-dialog.md): An alert dialog that asks the user to confirm throwing away unsaved edits.
- [Drawer](/design/components/drawer.md): A panel that slides in from the bottom edge (or any edge), built on vaul, with a drag handle and swipe-to-dismiss.
- [DropdownMenu](/design/components/dropdown-menu.md): A menu of actions for one object, opening from a button; 250ms in from 97%, 150ms out to 99%.
- [Popover](/design/components/popover.md): A light panel anchored to its trigger; opens in 250ms from 97% scale (`.t-dropdown`).
- [Sheet](/design/components/sheet.md): A panel that slides in from an edge; opens in 400ms and closes in 350ms on the smooth-out ease (`--panel-*`).
- [Tooltip](/design/components/tooltip.md): A short ink label on hover or focus: `foreground` fill with `background` text, 12px, 150ms in after an 80ms delay, 50ms out (`.t-tt`).
