Alert Dialog
interlace-ui/alert-dialogFreeComponent
A modal confirmation dialog for *destructive or otherwise consequential* actions ("Delete project", "Sign out everywhere"). Distinct from `Dialog`: the underlying Base UI primitive disables outside-click and Escape-only dismissal so the user MUST…
Install it
npx shadcn@latest add https://ds.interlace.tools/r/alert-dialog.jsonSource
1'use client';23import * as React from 'react';45// @interlace/alert-dialog v1.1.0 — Interlace design system.6// Docs, props and live preview: https://ds.interlace.tools/c/alert-dialog7// What changed since: https://ds.interlace.tools/c/alert-dialog#history8// Generated banner — keep it, the upgrade diff reads this version.910/**11 * @interlace/ui — AlertDialog12 *13 * A modal confirmation dialog for *destructive or otherwise consequential*14 * actions ("Delete project", "Sign out everywhere"). Distinct from `Dialog`:15 * the underlying Base UI primitive disables outside-click and Escape-only16 * dismissal so the user MUST acknowledge with a deliberate Cancel/Confirm17 * action (WAI-ARIA `alertdialog` pattern). All keyboard / focus / ARIA come18 * from `@base-ui/react/alert-dialog`; this file is a pure styled surface.19 *20 * ## Anatomy21 *22 * AlertDialog (Root, controlled or uncontrolled)23 * ├─ AlertDialogTrigger (the originating button)24 * └─ AlertDialogPortal (escape stacking context)25 * ├─ AlertDialogBackdrop (fixed scrim — bg-foreground/60)26 * └─ AlertDialogPopup (centered card — data-min-viewport root)27 * ├─ AlertDialogTitle ("Delete project?")28 * ├─ AlertDialogDescription ("This cannot be undone.")29 * └─ AlertDialogClose (Cancel + Confirm slots — consumer-composed)30 *31 * ## MIN_VIEWPORT — 32032 *33 * A destructive confirmation must work on the narrowest supported phone34 * (iPhone SE, 320 CSS px). The popup is capped at `--container-prose`35 * (65ch) and centered with `inset-0` + flex — it gracefully shrinks below36 * its max-width on small viewports, so the 320-floor is structurally safe.37 *38 * | Rule | Concept | Where in this file |39 * | ---- | -------------------------------- | ------------------------------------------------------------- |40 * | R4 | Extends Base UI part props | `React.ComponentProps<typeof BaseAlertDialog.*>` on every part |41 * | R6 | data-slot on every named part | `data-slot="alert-dialog"` / `"alert-dialog-trigger"` / `…-portal"` / `…-backdrop"` / `…-popup"` / `…-title"` / `…-description"` / `…-close"` |42 * | R7 | className merged + ...rest | `cn(BASE, className)` + `{...props}` spread on every part |43 * | R8 | No `isXxx` prefix on booleans | All booleans inherited from Base UI use the no-`is` form |44// … truncated
More from interlace-ui
All 140 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| A11y Startera11y-starter | interlace-ui | Components | Free | no deps | |
| Accordionaccordion | interlace-ui | Components | Free | no deps | |
| Alertalert | interlace-ui | Components | Free | no deps | |
| Animated Gradient Textanimated-gradient-text | interlace-ui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | interlace-ui | Components | Free | no deps | |
| Animated Listanimated-list | interlace-ui | Components | Free | no deps | |
| Article Cardarticle-card | interlace-ui | Components | Free | no deps | |
| Article List Gridarticle-list-grid | interlace-ui | Components | Free | no deps |
