For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
Home

Alert Dialog

A modal dialog that interrupts the user with important content and requires a response before continuing.

import { Button } from "@/components/ui/button";
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog";

export const AlertDialogDemo = () => (
    <AlertDialog>
      <AlertDialogTrigger asChild><Button variant="outline">Delete account</Button></AlertDialogTrigger>
      <AlertDialogContent>
        <AlertDialogHeader>
          <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
          <AlertDialogDescription>This action cannot be undone. This will permanently delete your account and remove your data from our servers.</AlertDialogDescription>
        </AlertDialogHeader>
        <AlertDialogFooter>
          <AlertDialogCancel>Cancel</AlertDialogCancel>
          <AlertDialogAction>Continue</AlertDialogAction>
        </AlertDialogFooter>
      </AlertDialogContent>
    </AlertDialog>
  );

Destructive Action

Use AlertDialogAction with variant="destructive" when confirming an irreversible operation.

Props

AlertDialog

PropTypeDefaultDescription
openboolean—Controlled open state
defaultOpenbooleanfalseInitial open state
onOpenChange(open: boolean) => void—Callback when open state changes

AlertDialogContent

PropTypeDefaultDescription
classNamestring—Additional CSS classes

AlertDialogAction / AlertDialogCancel

PropTypeDefaultDescription
classNamestring—Override default button styles
asChildbooleanfalseRender as child element

Usage

import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogTrigger,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
 
<AlertDialog>
  <AlertDialogTrigger asChild>
    <Button variant="outline">Open</Button>
  </AlertDialogTrigger>
  <AlertDialogContent>
    <AlertDialogHeader>
      <AlertDialogTitle>Are you sure?</AlertDialogTitle>
      <AlertDialogDescription>
        This action cannot be undone.
      </AlertDialogDescription>
    </AlertDialogHeader>
    <AlertDialogFooter>
      <AlertDialogCancel>Cancel</AlertDialogCancel>
      <AlertDialogAction>Continue</AlertDialogAction>
    </AlertDialogFooter>
  </AlertDialogContent>
</AlertDialog>

Specs

# Mint — Alert Dialog Specs
 
## Component
- name: alert-dialog
- file: registry/mint/alert-dialog.tsx
- installs to: components/ui/alert-dialog.tsx
- dependencies: radix-ui
- registryDependencies: button
 
## What is it
A blocking modal dialog that requires the user to make an explicit choice before
continuing. Unlike Dialog, it cannot be dismissed by clicking the overlay or
pressing Escape — the user must click Cancel or Confirm. Use it exclusively for
destructive or irreversible actions: deleting data, leaving unsaved changes,
revoking access. Do not use it for informational content — use Dialog instead.
 
## Visual identity
Identical frame to Dialog: white background, generously rounded corners
(Mint's 1.25rem radius), a soft glassy border, and shadow-lg, centered on
screen with a semi-transparent overlay. Two-button footer with Cancel
(outline) on the left and Action (primary, Mint green) on the right. The
visual weight of the Action button signals the severity of the confirmation.
 
## Design tokens
--background: oklch(1 0 0)               — dialog background
--foreground: oklch(0.145 0 0)           — title text
--muted-foreground: oklch(0.52 0.06 155) — description text
--border: oklch(0.88 0.04 155 / 60%)     — dialog border
--primary: oklch(0.5 0.14 155)           — action button background
--primary-foreground: oklch(1 0 0)       — action button text
--destructive: oklch(0.55 0.25 15)       — destructive action override
--radius: 1.25rem                        — rounded-lg
 
## Dark theme
--background: oklch(0.145 0 0)
--foreground: oklch(0.985 0 0)
--muted-foreground: oklch(0.6 0.06 155)
--border: oklch(0.32 0.05 155 / 40%)
 
## shadcn config (components.json)
- style: new-york
- rsc: true
- tsx: true
- baseColor: neutral
- cssVariables: true
- iconLibrary: lucide
- aliases:
  - components → @/components
  - ui → @/components/ui
  - utils → @/lib/utils
  - lib → @/lib
  - hooks → @/hooks
 
## Sub-components
- AlertDialogTrigger  → opens the dialog
- AlertDialogContent  → the modal panel (includes portal + overlay)
- AlertDialogHeader   → wraps title + description
- AlertDialogFooter   → wraps Cancel + Action buttons
- AlertDialogTitle    → required — describes what is being confirmed
- AlertDialogDescription → required — explains the consequences
- AlertDialogAction   → confirm button, styled as primary by default
- AlertDialogCancel   → dismiss button, styled as outline by default
 
## States
- closed:   dialog not mounted in DOM
- open:     fade-in + zoom-in-95 animation, overlay fades in
- closing:  fade-out + zoom-out-95 animation
- overlay:  bg-black/50, blocks interaction with page content
 
## Conventions
- Always include both AlertDialogTitle and AlertDialogDescription
- AlertDialogDescription must explain the consequences, not just ask for confirmation
- For destructive confirms: add className="bg-destructive text-white hover:bg-destructive/90" to AlertDialogAction
- Never use Alert Dialog for non-destructive confirmations — use Dialog instead
- Always use AlertDialogTrigger asChild with your own Button component
- Footer order: Cancel left, Action right (matches platform conventions)

Installation

GIN Design Plugin
$ npx shadcn add https://gin-design.vercel.app/alert-dialog