| UI or UX | UI + UX - Focused modal task layer | UI + UX - Consequential alert decision |
| 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. | 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 | Use the modal interruption only for compact tasks that genuinely need temporary focus before the user returns to the page. | Help the person reach a clear task outcome. |
| Good UI | 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 vague popup titled Popup floats over active page controls and offers only OK. | The red destructive action is enabled immediately and sits where users expect the routine primary button. |
| Good UX | 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 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 | 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 workflow is long, multi-step, shareable, or needs browser navigation. | The action is routine and easily reversible. |
| Required state | Closed page state with an obvious invoking control. | Pre-action state with an explicit consequential trigger. |
| Accessibility burden | 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 a modal as a generic container for routine information that could stay inline. | Asking users to confirm every routine action until they stop reading. |