| UI or UX | UI + UX - Blocking urgent-response modal | UI + UX - Urgent current-task status message | UI + UX - Focused modal task layer | UI + 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. |