AlertDialog
A modal with two ways out and no third — for the action a reader cannot take back.
Alert dialog
An interruption with no escape that is not a choice: no outside-click dismiss, no close X. Action and Cancel reuse the Button vocabulary, so a destructive confirm inherits the label-in-ink / red-on-the-border treatment rather than inventing a second red.
Usage
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogOverlay,
AlertDialogPortal,
AlertDialogTitle,
AlertDialogTrigger,
} from '@oceanic-hub/brand-system'<AlertDialog>
<AlertDialogTrigger>…</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>…</AlertDialogTitle>
<AlertDialogDescription>…</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>…</AlertDialogCancel>
<AlertDialogAction>…</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>Composition
Use the following composition to build an AlertDialog:
AlertDialog
├── AlertDialogTrigger
└── AlertDialogContent
├── AlertDialogHeader
│ ├── AlertDialogTitle
│ └── AlertDialogDescription
└── AlertDialogFooter
├── AlertDialogCancel
└── AlertDialogActionReach for it when the next click is irreversible: deleting records, cancelling a run mid-flight, revoking access someone is using. The question goes in the title and the consequence in the description, so the two buttons can be verbs — "Delete permanently" and "Keep them", never "OK" and "Cancel".
It is not Dialog. A dialog is dismissable and carries a close X, because its job is to hold
a form or a detail the reader may abandon; this one has no close affordance at all, and that
absence IS the component. Radix refuses to dismiss it on an outside click, and focus lands on
AlertDialogCancel when it opens — so a dialog rendered without a Cancel leaves a keyboard
user with the Escape key and nothing else. Escape does still close it, which is the
alertdialog pattern's requirement rather than an oversight; intercept it with
onEscapeKeyDown on a surface holding unsaved work. And if nothing is at stake, none of this
applies: a result the reader can undo is a toast (Toaster) with an undo action, not an
interruption.
The confirm inherits the Button vocabulary through className, so a destructive one is
buttonVariants({ variant: 'destructive' }) — the label stays in ink and the red moves to the
border (@OCE-1747). It is the same red the rest of the product already uses for the same
meaning; a dialog that paints its own is a second vocabulary for danger.
RTL is not supported, and upstream ships an RTL example. Nothing in this package has been
laid out or measured right-to-left, so the refusal is written down in pairings.json under
direction rather than left to be discovered. Two more of upstream's examples belong to its
Base UI generation rather than to the Radix one we are on — a size prop on the content and
an AlertDialogMedia part — and both are composition here, one section each below.
Compact
Narrow the content to max-w-sm when the question is one line and both answers are one word — a confirmation that needs no room to explain itself. Upstream spells this size="sm", a prop that belongs to its Base UI generation; width is the only thing it changes, so here it is the className and the component keeps one shape.
With a mark
A bordered plate above the title, for a dialog that opens far from whatever triggered it and has to say what kind of thing it is before it is read. The mark is decorative and hidden from assistive tech — the title still carries the consequence, because an icon cannot. Upstream has a dedicated AlertDialogMedia part in its Base UI generation; here it is a div and the same 1px elevation every other surface uses.
API Reference
See the AlertDialog API page for every prop of every part, with types, defaults and the contract that pins them.