Back to compare picker

Alert dialog vs Alert vs Modal dialog vs Confirmation dialog

Choose alert dialog when an important current-workflow message requires users to acknowledge, cancel, retry, sign out, review, or choose a response before continuation is safe.

Decision dimensions

Dimension Alert dialogAlertModal dialogConfirmation dialog
UI or UX UI + UX - Blocking urgent-response modalUI + UX - Urgent current-task status messageUI + UX - Focused modal task layerUI + UX - Consequential alert decision
UI guidance Render an alert dialog as a modal response surface with a condition-specific title, consequence text, role alertdialog or platform equivalent, inactive background, and buttons labelled by outcome.Render an alert as a visible message in the current task area with a clear severity cue, short title, consequence-focused body, and one direct action or safe dismissal when appropriate.Render a titled layer above a dimmed or otherwise unavailable page, with clear task content, named actions, visible close or cancel affordance, and stable scroll boundaries.Render an alert-style modal decision with a specific title, consequence description, safe cancellation, and a destructive action label that names the object or scope.
UX guidance Interrupt only when a current-workflow condition needs an explicit response before users can safely continue.Use alerts when the user must notice a time-sensitive condition that affects their current task, such as session expiry, lost connection, unsaved work risk, failed submission, or a security-sensitive hold.Use the modal interruption only for compact tasks that genuinely need temporary focus before the user returns to the page.Interrupt users only when the action has a meaningful consequence that cannot be safely recovered afterward.
Good UI A Session locked alert dialog says the editor is paused because the account opened elsewhere, offers Stay signed in and Sign out, and keeps the background editor unavailable.A session alert appears above the active editor, says the session expires in 2 minutes, and offers Save draft while keeping the editor usable.Account settings opens in a titled dialog with one display-name field, Save, Cancel, close control, and dimmed inactive page context.Delete Research archive? explains that 14 notes and shared links will be permanently removed, offers Keep archive, and labels the danger action Delete archive.
Bad UI A popup says Warning with only OK while the page behind it still accepts input.A vague red strip says Warning with no object, consequence, or next step.A vague popup titled Popup floats over active page controls and offers only OK.A popup says Are you sure? with OK and Cancel but does not name the project, notes, or irreversible outcome.
Good UX Tab stays inside the dialog, Escape follows the safe cancel path, Stay signed in returns focus to the editor, and Sign out moves to the signed-out state.Users can renew the session, save a draft, or inspect details without losing typed work.Opening moves focus to the display-name field, Tab remains inside the layer, Escape cancels, and closing returns focus to Open dialog.Cancel, Escape, and Keep archive leave the archive unchanged and return focus to Delete archive.
Bad UX Users can click Delete, navigate away, or keep typing behind a blocking security message.The only warning that unsaved work will be lost disappears after five seconds.Users can click background Delete or Navigate controls while the modal is still open.Every archive, filter, and dismiss action opens the same confirmation until users click through automatically.
Best fit An urgent current-workflow condition requires acknowledgement, cancellation, retry, sign-out, review, or another explicit response before continuation.A current task has a time-sensitive warning, error, or important status change.A short task must interrupt normal page interaction but should return users to the same context afterward.The action is destructive, irreversible, costly, security-sensitive, privacy-affecting, or externally visible.
Avoid when The message is urgent but users can keep working safely after seeing it.The message belongs beside one object, row, field, or local section.The content is only informational and does not require blocking the page.The action is routine and easily reversible.
Required state Normal workflow state with a visible invoking event or system condition.No-alert state with the task operating normally.Closed page state with an obvious invoking control.Pre-action state with an explicit consequential trigger.
Accessibility burden Use alertdialog semantics only for important modal messages that require a response.Use role alert for urgent dynamic text and avoid putting interactive controls inside the role-alert node itself.Use dialog semantics with an accessible name from the visible title.Use alertdialog semantics or platform equivalent when the decision is urgent and requires a response.
Common misuse Using an alert dialog as a dramatic version of a routine non-modal alert.Using a disappearing toast for warnings users must act on before continuing.Using a modal as a generic container for routine information that could stay inline.Asking users to confirm every routine action until they stop reading.

Alert dialog

UI or UX
UI + UX - Blocking urgent-response modal
UI guidance
Render an alert dialog as a modal response surface with a condition-specific title, consequence text, role alertdialog or platform equivalent, inactive background, and buttons labelled by outcome.
UX guidance
Interrupt only when a current-workflow condition needs an explicit response before users can safely continue.
Good UI
A Session locked alert dialog says the editor is paused because the account opened elsewhere, offers Stay signed in and Sign out, and keeps the background editor unavailable.
Bad UI
A popup says Warning with only OK while the page behind it still accepts input.
Good UX
Tab stays inside the dialog, Escape follows the safe cancel path, Stay signed in returns focus to the editor, and Sign out moves to the signed-out state.
Bad UX
Users can click Delete, navigate away, or keep typing behind a blocking security message.
Best fit
An urgent current-workflow condition requires acknowledgement, cancellation, retry, sign-out, review, or another explicit response before continuation.
Avoid when
The message is urgent but users can keep working safely after seeing it.
Required state
Normal workflow state with a visible invoking event or system condition.
Accessibility burden
Use alertdialog semantics only for important modal messages that require a response.
Common misuse
Using an alert dialog as a dramatic version of a routine non-modal alert.

Alert

UI or UX
UI + UX - Urgent current-task status message
UI guidance
Render an alert as a visible message in the current task area with a clear severity cue, short title, consequence-focused body, and one direct action or safe dismissal when appropriate.
UX guidance
Use alerts when the user must notice a time-sensitive condition that affects their current task, such as session expiry, lost connection, unsaved work risk, failed submission, or a security-sensitive hold.
Good UI
A session alert appears above the active editor, says the session expires in 2 minutes, and offers Save draft while keeping the editor usable.
Bad UI
A vague red strip says Warning with no object, consequence, or next step.
Good UX
Users can renew the session, save a draft, or inspect details without losing typed work.
Bad UX
The only warning that unsaved work will be lost disappears after five seconds.
Best fit
A current task has a time-sensitive warning, error, or important status change.
Avoid when
The message belongs beside one object, row, field, or local section.
Required state
No-alert state with the task operating normally.
Accessibility burden
Use role alert for urgent dynamic text and avoid putting interactive controls inside the role-alert node itself.
Common misuse
Using a disappearing toast for warnings users must act on before continuing.

Modal dialog

UI or UX
UI + UX - Focused modal task layer
UI guidance
Render a titled layer above a dimmed or otherwise unavailable page, with clear task content, named actions, visible close or cancel affordance, and stable scroll boundaries.
UX guidance
Use the modal interruption only for compact tasks that genuinely need temporary focus before the user returns to the page.
Good UI
Account settings opens in a titled dialog with one display-name field, Save, Cancel, close control, and dimmed inactive page context.
Bad UI
A vague popup titled Popup floats over active page controls and offers only OK.
Good UX
Opening moves focus to the display-name field, Tab remains inside the layer, Escape cancels, and closing returns focus to Open dialog.
Bad UX
Users can click background Delete or Navigate controls while the modal is still open.
Best fit
A short task must interrupt normal page interaction but should return users to the same context afterward.
Avoid when
The content is only informational and does not require blocking the page.
Required state
Closed page state with an obvious invoking control.
Accessibility burden
Use dialog semantics with an accessible name from the visible title.
Common misuse
Using a modal as a generic container for routine information that could stay inline.

Confirmation dialog

UI or UX
UI + UX - Consequential alert decision
UI guidance
Render an alert-style modal decision with a specific title, consequence description, safe cancellation, and a destructive action label that names the object or scope.
UX guidance
Interrupt users only when the action has a meaningful consequence that cannot be safely recovered afterward.
Good UI
Delete Research archive? explains that 14 notes and shared links will be permanently removed, offers Keep archive, and labels the danger action Delete archive.
Bad UI
A popup says Are you sure? with OK and Cancel but does not name the project, notes, or irreversible outcome.
Good UX
Cancel, Escape, and Keep archive leave the archive unchanged and return focus to Delete archive.
Bad UX
Every archive, filter, and dismiss action opens the same confirmation until users click through automatically.
Best fit
The action is destructive, irreversible, costly, security-sensitive, privacy-affecting, or externally visible.
Avoid when
The action is routine and easily reversible.
Required state
Pre-action state with an explicit consequential trigger.
Accessibility burden
Use alertdialog semantics or platform equivalent when the decision is urgent and requires a response.
Common misuse
Asking users to confirm every routine action until they stop reading.
Decision rules
  • Choose alert dialog when an important current-workflow message requires users to acknowledge, cancel, retry, sign out, review, or choose a response before continuation is safe.
  • Choose alert when users need immediate notice of a time-sensitive task condition but should keep working without a modal response.
  • Choose modal dialog when the layer contains a short task, form, picker, or settings interaction rather than an urgent message.
  • Choose confirmation dialog when the response-required interruption follows a user-initiated destructive, costly, security-sensitive, or difficult-to-reverse command before it commits.
  • Use warning text when the severe consequence can stay inline before the risky action instead of blocking the whole page.
  • Use site alert or banner when the message applies broadly across the service, account, product, or many pages.
  • Do not use alert dialog for page-load announcements, routine success feedback, marketing messages, low-risk confirmations, or information that can be safely read later.
  • If the surface is modal, keep background content inactive, move focus into the dialog, contain Tab and Shift+Tab, support Escape only when safe, and return focus after the response.
  • Label response buttons by outcome, such as Stay signed in, Sign out, Retry payment, Choose another method, Keep editing, or Review warning; avoid vague OK-only responses when the consequence matters.
  • Escalate from alert to alert dialog only when unsafe continuation is possible without a response; escalate from alert dialog to a page or error state when recovery needs longer reading, navigation, or durable state.
Inspect live examples
Failure modes
  • A session-lock message appears as a non-modal alert and users keep editing content that can no longer be saved.
  • A routine saved message opens an alert dialog and trains users to dismiss future interruptions without reading.
  • A normal settings form is labelled as alertdialog even though there is no urgent response-required message.
  • A destructive delete command uses a generic alert dialog with OK instead of a confirmation dialog that names object, scope, and safe cancellation.
  • Background controls remain clickable while the alert dialog is open, so page state changes behind the blocking message.
  • The dialog has no accessible title or description, so assistive technology users hear an interruption without the consequence.
  • Focus does not return after close, leaving keyboard users outside the workflow that triggered the interruption.