Alert Dialog
A React component in Beamline's Overlays category, in the free sample.
A blocking confirmation that must be answered: the scrim does not dismiss it, focus starts on the safe choice, and an async action keeps it open until the work finishes.
Use it for
- Irreversible or costly actions: revoke a key, delete a workspace, publish to production.
Not for
- Routine confirmations (confirm-morph).
- Anything informational (toast or alert).
Anatomy
- AlertDialog
- AlertDialogTrigger
- AlertDialogContent (scrim, title, description)
- AlertDialogFooter
- AlertDialogCancel
- AlertDialogAction
Variants
- action: danger (default), primary
States
- closed
- open
- working (action loading, cancel disabled)
- failed (reason in the description)
- narrow (a phone: Cancel and the action share the row in equal parts)
Keyboard
- Focus starts on Cancel
- Escape cancels
- Tab is trapped
- focus returns to the trigger
Motion
Same as dialog. Opens out of whatever opened it (_shared/use-open-from.ts): it starts as the opener's box, offset onto it, grows to its place over the considered duration while its content fades in, and closes back into the opener in 180 ms. Without an opener (a shortcut) the ordinary entrance runs. A failure placed above the actions grows in (.enter-grow), so the dialog grows with it. Reduced motion: it fades.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | ReactNode | — | On AlertDialogContent: The question: "Revoke production-server?" |
description | ReactNode | — | On AlertDialogContent: What happens, and whether it can be undone. |
AlertDialogAction variant | ButtonVariant | "danger" | variant: On AlertDialogAction: Visual weight of the control. Defaults to "danger". |
AlertDialogAction loading | boolean | — | loading: On AlertDialogAction: Shows the loading state while data or an operation is pending. Defaults to false. |
open / defaultOpen / onOpenChange | boolean | — | open: Controlled open state; omit to use defaultOpen. defaultOpen: Initial open state when uncontrolled; defaults to false. onOpenChange: Reports an open-state change; no callback by default. |
classNames | AlertDialogClassNames | — | On AlertDialogContent: Classes for the named visual parts; no part overrides by default. |
style / ref | CSSProperties / native Ref | — | style: Inline styles on the documented visual root; no overrides by default. ref: Receives the documented native target or imperative handle; omitted by default. |
AlertDialogAction.variant | ButtonVariant | — | On AlertDialogAction: Visual weight of the control. Defaults to "danger". |
AlertDialogAction.loading | boolean | — | On AlertDialogAction: Shows the loading state while data or an operation is pending. Defaults to false. |
Built from
Used in
- Security
- Admin users
- API keys & webhooks
- Category manager
- Content releases
- Document finder
- Document history
- Draft orders
- Inventory item
- Issued ticket
- Metadata fields
- Nutrition library
- Order detail
- Payroll cycles
- Playbook check
- Probing chart
- Program modules
- Prototype review
- Record editor
- Review page builder
- Roles & permissions
- Settings
- Stop runs
Dependencies
@radix-ui/react-alert-dialog
Import
import { AlertDialogContent, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, AlertDialog, AlertDialogTrigger } from "@beamline/alert-dialog";
Get it
Alert Dialog is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Alert Dialog is included in the free MIT sample. Get Beamline · Connect your agent
More in Overlays
- Command menu: Search-first list of every action: ranked matching, groups, keycap shortcuts and nested pages; inline as CommandPalette or in a ⌘K dialog as CommandMenu.
- Toast: Short results of an action stacked at an edge: point at the stack to fan it out and pause the timers; undo or retry in place; Alt+T, Escape and a swipe…
- Share dialog: Share a document, board or project: invite people by name or email with the access they get, change or remove anyone's access in place, and set who the…
- Context menu: Actions for an object on right-click, long-press, Shift+F10 or the menu key, opened at the pointer, with the same rows as the dropdown menu.
- Hover card: A preview of a person, link or record on hover or keyboard focus, without leaving the page; HoverCardProfile is the standard person preview.
- Product tour: A short guided tour over the real interface: a spotlight that glides from one element to the next while the rest of the screen dims, and a card beside…
- Bottom sheet: A phone panel that rests at a peek and follows the finger to full height; a flick down closes it, and the handle works from the keyboard.
- Sheet: A panel that slides in from an edge with the page still visible behind it: header and footer stay put while the body scrolls.
- Dropdown menu: A list of actions behind a trigger, with shortcuts, check items, headings and submenus; one highlight glides under the pointer and jumps with the keyboard.
- Dialog: A focused task over the page (create, invite, rename) with a title, body and footer; focus moves in, is trapped and returns on close.
- Popover: A small surface anchored to a trigger for a short form, a filter or an explanation; focus moves in and returns on close.
- Tooltip: Short supporting text for a control: opens after a moment on hover and at once on keyboard focus; inside a toolbar group the next one opens instantly.