Alert dialog
Component preview
A modal dialog that interrupts a consequential action and requires an explicit confirm or cancel decision.
Build pack
Choose the task and destination. Technical names stay in English.
In your own words
Documented aliases: confirmation dialog, destructive confirmation, warning dialog
Try it
Compare all three behaviors
Shared comparison scenario: A project item opens a focused overlay while the underlying workspace remains unavailable until the user finishes or closes it.
This context stays fixed. Switch concepts to observe the mission, edge case, and specimen specific to each behavior.
Alert dialog
An Alert dialog is for a short consequential decision, not a general form and not a media viewer.
Your task
Open the warning, read the named consequence, cancel with the keyboard, then reopen and confirm deliberately.
Edge case to verify
While deletion is submitting, both actions prevent duplicate activation and the dialog reports the pending state.
Mission
Open the warning, read the named consequence, cancel with the keyboard, then reopen and confirm deliberately.
Select a marker directly on the specimen, or use the list below, to see its role. Hide the markers to operate the lab without obstruction.
Backdrop
The layer that separates a modal surface from inactive page content.
Use a Modal dialog for a general contained task; use Alert dialog for a short consequential decision and Lightbox when viewing media is the task.
Modal dialogLightbox is a media-specific modal composition; a general Modal dialog handles tasks and an Alert dialog handles a consequential decision.
LightboxContain focus
While modal, keyboard focus stays inside the surface until it closes.
Require a decision
The surface remains until the user deliberately confirms or cancels the consequential action.
Decision closed with workspace intact
Decision closed with workspace intact
Initial deletion decision open
Initial deletion decision open
Decision closed after cancellation
Decision closed after cancellation
Deletion decision reopened after cancellation
Deletion decision reopened after cancellation
Deletion submitting
Deletion submitting
Decision closed after confirmed deletion
Decision closed after confirmed deletion
Deletion decision reopened after confirmation
Deletion decision reopened after confirmation
Decision closed with workspace intact → Initial deletion decision open
Delete workspace opens the warning and initially focuses the safer Keep it action.
Initial deletion decision open → Decision closed after cancellation
Activating Keep it cancels deletion, closes the warning, and allows it to be reopened.
Initial deletion decision open → Decision closed with workspace intact
Escape safely closes the warning before submission and returns focus without recording a confirmed result.
Decision closed after cancellation → Deletion decision reopened after cancellation
Delete workspace reopens the same warning after a prior cancellation.
Deletion decision reopened after cancellation → Decision closed after cancellation
Keep it or Escape closes the reopened warning and preserves the prior cancellation result.
Initial deletion decision open → Deletion submitting
Delete permanently starts the simulated submission while the dialog stays open and both actions become disabled.
Deletion decision reopened after cancellation → Deletion submitting
Delete permanently replaces the prior cancellation result with a new pending submission.
Deletion submitting → Decision closed after confirmed deletion
When the simulated submission finishes, the dialog closes and the confirmed result is announced.
Decision closed after confirmed deletion → Deletion decision reopened after confirmation
Delete workspace can reopen the replayable warning after the demonstration result is confirmed.
Deletion decision reopened after confirmation → Decision closed after confirmed deletion
Escape closes the reopened warning and preserves the prior confirmed demonstration result.
Deletion decision reopened after confirmation → Decision closed after cancellation
Keep it closes the reopened warning and changes the current demonstration result to cancelled.
Deletion decision reopened after confirmation → Deletion submitting
Delete permanently starts another pending demonstration submission from the reopened warning.
AlertDialog.Root
Equivalence caveat: Alert Dialog is reserved for short consequential decisions and does not make every confirmation flow appropriate.
Verify binding sourceW3C WAI · standard · 2026-07-16
Claim covered: Alert dialog: alert dialog semantics, consequential-decision focus placement, and explicit action guidance.
Radix Primitives · documentation · 2026-07-16
Claim covered: Alert dialog: documented Radix Alert Dialog parts, focus management, cancel action, and modal behavior.
Verified on 2026-07-16 · rev. 1