# Alert Dialog

> A token-driven confirmation alert dialog with a destructive primary action, a cancel action, focus management, Escape to close, and a live result line — fully design-system agnostic.

- Category: Dialog
- Frameworks: Vanilla, React + CSS, React + Tailwind
- Design system: Aperture
- Dark mode: yes
- Access: premium (Atheros AI Pass)
- Page: https://builder.atheros.ai/components/alert-dialog
- Preview: https://d17nmjscumqk5d.cloudfront.net/builder/templates/tpl_builder_alert_dialog/preview-a4685de33da4.webp

## Features

- Confirmation alert dialog with a destructive primary action and a safe cancel action
- Uses `role="alertdialog"` so assistive tech treats it as an urgent, blocking prompt
- Scale-and-fade entrance built purely from `transform` and `opacity`
- Backdrop scrim with a configurable blur driven by a token
- Live result line announces the chosen outcome via `aria-live`
- Focus moves to the safe Cancel action on open and returns to the trigger on close
- Focus is trapped inside the dialog while it is open
- Closes via Not now, Publish, an overlay click, or the Escape key — defaulting to cancel
- Dark and light theming driven by the host shell toggling `body.dark`
- Responsive layout that adapts padding down to 280px
- Fully respects `prefers-reduced-motion`

## Accessibility

- **Alert role** — `role="alertdialog"` with `aria-modal="true"` on the dialog
- **Labelling** — `aria-labelledby` and `aria-describedby` point at the title and text
- **Default focus** — Focus lands on the safe Cancel action on open
- **Focus management** — Focus returns to the trigger on close
- **Focus trap** — Tab and Shift+Tab cycle within the dialog while open
- **Escape and overlay** — Escape and overlay click both default to cancel
- **Live result** — `aria-live="polite"` on the result line announces the outcome
- **Reduced motion** — `prefers-reduced-motion: reduce` disables all animations

## Keyboard shortcuts

- `Enter` — Activate the focused trigger or button
- `Space` — Activate the focused button
- `Escape` — Cancel and close the open dialog
- `Tab` — Move focus forward, trapped within the open dialog

## Common questions

**Which frameworks is Alert Dialog available in?**

Alert Dialog ships as Vanilla, React + CSS and React + Tailwind — HTML, CSS, JS and React source you can copy, download or clone into Atheros AI Builder.

**Is Alert Dialog free?**

Alert Dialog is a premium component. Anyone can preview it; the source, downloads and AI customisation are included with Atheros AI Pass.

**Does Alert Dialog support dark mode?**

Yes. Alert Dialog ships light and dark themes, both drawn from the Aperture design system's tokens. Switch the preview to dark mode to compare them.

## Get the code

Preview Alert Dialog live, then sign in to copy or download the source, apply another design system, or ask the AI assistant to change it: https://builder.atheros.ai/components/alert-dialog

Every component on https://builder.atheros.ai is also reachable from Claude Code, Cursor and Codex through the Atheros MCP server (paid plans). Component index: https://builder.atheros.ai/llms-components.txt
