# Modal dialogs

> A dialog that blocks everything costs attention, and it is worth that only when a decision truly must come first.

Area: Dialogs and overlays. Evidence behind the answer: Moderate. Last checked November 12, 2026.
Page: https://uxreference.com/dialogs/modal

## The answer

Use a modal only when people must respond before anything else, and only after their own action.

- **Moderate.** Use a modal dialog only when people must respond before anything else can continue. Put everything else on the page. (https://uxreference.com/dialogs/modal#rule-1)
- **Moderate.** Open a modal only in response to something people did, except for warnings they must see, such as an expiring session. (https://uxreference.com/dialogs/modal#rule-2)

## The problem

A modal dialog stops everything else until it is dealt with, which helps when a decision truly must come first and costs attention and time when it need not.

## How to decide

1. Must the person respond before anything else can sensibly continue?
2. No: do not use a modal dialog. Use the page, a popover or a drawer.
3. Yes: go to 2.
4. Does the decision need information on the page behind? If yes, put the decision in the page ([rule 7](https://uxreference.com/dialogs/modal#rule-7)).
5. Otherwise use a modal dialog, opened by the person's own action where possible ([rule 2](https://uxreference.com/dialogs/modal#rule-2)), one at a time ([rule 6](https://uxreference.com/dialogs/modal#rule-6)).

## Every rule

Each rule has a grade: Settled (required by WCAG AA or law, or replicated research), Strong, Moderate, Weak, or Unsettled (use the stated default until the evidence settles).

#### Rule 1. Moderate

Use a modal dialog only when the person must respond before anything else can sensibly continue. Put everything else in the page or in a non-blocking element.

- Applies when: Deciding whether to interrupt.
- Based on: Practitioner research
- Principle: Keep people in control

Why: NN/g, USWDS and Carbon agree that modals are for critical or blocking decisions and should be rare. One study (100 students) found fixing an error about a second faster with an in-page message than with a popup. Interruption research points the same way but is not about dialogs.

Sources: [Modal & Nonmodal Dialogs: When (& When Not) to Use Them](https://www.nngroup.com/articles/modal-nonmodal-dialog/); [Popups (NN/g article by Anna Kaley)](https://nngroup.com/articles/popups/); [Modal (U.S. Web Design System)](https://designsystem.digital.gov/components/modal/); [carbon-2025-modal-danger](https://carbondesignsystem.com/components/modal/usage/); [hofseth-2019-popup-vs-inform](https://core.ac.uk/download/335055254.pdf)

Link: https://uxreference.com/dialogs/modal#rule-1

#### Rule 2. Moderate

Open a modal dialog in response to something the person did, not on your own schedule, except for warnings they must see such as an expiring session.

- Applies when: Deciding what triggers a dialog.
- Based on: Practitioner research
- Principle: Keep people in control

Why: USWDS and NN/g agree. One small study (13 students) found most people opened dialogs they could choose to open and liked the choice; it had no comparison with automatic ones.

Sources: [Modal (U.S. Web Design System)](https://designsystem.digital.gov/components/modal/); [Popups (NN/g article by Anna Kaley)](https://nngroup.com/articles/popups/); [The polite pop-up: An experimental study of pop-up design characteristics and user experience](https://core.ac.uk/download/286030571.pdf)

Link: https://uxreference.com/dialogs/modal#rule-2

#### Rule 3. Moderate

While a modal dialog is open, keep the rest of the page from being operated, and keep keyboard focus inside the dialog.

- Applies when: A modal dialog is open.
- Based on: Standard or law
- Principle: Work for everyone

Why: The HTML standard makes the rest of the document inert for a modal dialog and the ARIA practices guide (non-binding) says the same. Neither is a conformance requirement on products, so no floor; rated on agreement.

Sources: [HTML Standard: the dialog element](https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element); [apg-2026-dialog-modal](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/); [Modal (U.S. Web Design System)](https://designsystem.digital.gov/components/modal/)

Link: https://uxreference.com/dialogs/modal#rule-3

#### Rule 4. Settled, WCAG AA

A person must be able to leave a modal dialog with the keyboard alone.

- Applies when: Focus is held inside a dialog.
- Based on: Standard or law
- Principle: Work for everyone

Why: WCAG 2.2 success criterion 2.1.2 No Keyboard Trap, level A. Holding focus in a dialog is allowed because the person can leave by a control or Escape.

Sources: [Understanding SC 2.1.2: No Keyboard Trap](https://www.w3.org/WAI/WCAG22/Understanding/no-keyboard-trap.html)

Link: https://uxreference.com/dialogs/modal#rule-4

#### Rule 5. Moderate

Close on Escape and provide a visible control that closes the dialog.

- Applies when: Any modal dialog that can be dismissed.
- Based on: Practitioner research
- Principle: Keep people in control

Why: APG, the HTML standard's default and Primer agree. WCAG treats Escape as a usual exit but does not require it.

Sources: [apg-2026-dialog-modal](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/); [HTML Standard: the dialog element](https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element); [Dialog (GitHub Primer React component)](https://primer.style/product/components/dialog/); [Understanding SC 2.1.2: No Keyboard Trap](https://www.w3.org/WAI/WCAG22/Understanding/no-keyboard-trap.html)

Link: https://uxreference.com/dialogs/modal#rule-5

#### Rule 6. Weak

Show one modal dialog at a time.

- Applies when: A second dialog could open over the first.
- Based on: Practitioner research
- Principle: Leave out what is not needed

Why: NN/g reports stacked popups as a problem, without method. The HTML standard allows stacking and gives no usability guidance.

Sources: [Popups (NN/g article by Anna Kaley)](https://nngroup.com/articles/popups/); [HTML Standard: the dialog element](https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element)

Link: https://uxreference.com/dialogs/modal#rule-6

#### Rule 7. Weak

Do not put in a modal dialog a decision that needs information the dialog covers.

- Applies when: The decision depends on content behind the dialog.
- Based on: Practitioner research
- Principle: Recognition over recall

Why: One practitioner article, argued from examples.

Sources: [Modal & Nonmodal Dialogs: When (& When Not) to Use Them](https://www.nngroup.com/articles/modal-nonmodal-dialog/)

Link: https://uxreference.com/dialogs/modal#rule-7

#### Rule 8. Unsettled

Whether a click outside should close a modal dialog is unsettled.

Until the evidence settles, use this default: Close on outside click only when nothing typed or chosen in the dialog would be lost.

- Applies when: Deciding on outside-click dismissal.
- Based on: Convention
- Principle: Keep people in control

Why: The HTML standard's default for modal dialogs does not close on outside click but allows opting in. USWDS can block closing until a choice is made. No study found.

Sources: [HTML Standard: the dialog element](https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element); [Modal (U.S. Web Design System)](https://designsystem.digital.gov/components/modal/)

Link: https://uxreference.com/dialogs/modal#rule-8

## Accessibility requirements

- WCAG 2.1.2 (A): no keyboard trap. (https://www.w3.org/WAI/WCAG22/Understanding/no-keyboard-trap.html)
- WCAG 2.4.3 (A) and 2.4.11 (AA): see [Focus management on open and close](https://uxreference.com/dialogs/focus-management). (https://www.w3.org/WAI/WCAG22/Understanding/focus-order.html)
- Name the dialog by its heading (USWDS, APG).

## Common mistakes

- A newsletter or promotion dialog that opens by itself.
- Dialogs stacked on dialogs.
- A dialog with no keyboard way out.

## Still open

- Do modal dialogs cause more errors or abandonment than in-page alternatives? One small study on error messages only.
- Outside-click dismissal: no evidence.
- No systematic review or large online experiment on modal dialogs was found.

## Related problems

- [Focus management on open and close](https://uxreference.com/dialogs/focus-management): Move focus into a dialog when it opens, and back to the control that opened it when it closes.
- [Confirmation dialogs](https://uxreference.com/dialogs/confirmation): Confirm rarely, label the buttons with what they do, and for severe actions make people engage with the detail.
- [Popovers](https://uxreference.com/dialogs/popovers): Open popovers on click, not hover, and close them with Escape or a click outside.
- [Drawers](https://uxreference.com/dialogs/drawers): Put a panel beside the content when people need both, and send long work to its own page.
- [Error message content](https://uxreference.com/forms/error-messages): Say which field is wrong and how to fix it, right next to the field.

## Sources

- [Modal & Nonmodal Dialogs: When (& When Not) to Use Them](https://www.nngroup.com/articles/modal-nonmodal-dialog/). Therese Fessenden, Nielsen Norman Group, 2017, expert guideline article with site examples; one unnamed usability study mentioned.
- [Popups (NN/g article by Anna Kaley)](https://nngroup.com/articles/popups/). Anna Kaley, Nielsen Norman Group, 2019, practitioner article; usability study without participant count, plus one author's tally (about 25 popups a week).
- [Modal (U.S. Web Design System)](https://designsystem.digital.gov/components/modal/). USWDS / GSA, n.d., component documentation; reports internal accessibility testing.
- [carbon-2025-modal-danger](https://carbondesignsystem.com/components/modal/usage/). n.d., component documentation.
- [hofseth-2019-popup-vs-inform](https://core.ac.uk/download/335055254.pdf). n.d., between-subjects experiment (group by student-number parity, not random).
- [The polite pop-up: An experimental study of pop-up design characteristics and user experience](https://core.ac.uk/download/286030571.pdf). Willermark, Islind, Appelgren, Eklund Taavo (HICSS 2020), 2020, observational lab study with screen recording and questionnaire; no control group.
- [HTML Standard: the dialog element](https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element). WHATWG, n.d., normative specification (living standard).
- [apg-2026-dialog-modal](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/). n.d., authoring guidance, non-binding (APG is not a standard).
- [Understanding SC 2.1.2: No Keyboard Trap](https://www.w3.org/WAI/WCAG22/Understanding/no-keyboard-trap.html). W3C WAI, n.d., normative standard (Understanding document, informative).
- [Dialog (GitHub Primer React component)](https://primer.style/product/components/dialog/). GitHub Primer, n.d., component documentation.

---
From Solved Problems in UX by Athen Pellicci, an evidence-graded reference of web interface problems. CC BY 4.0. https://uxreference.com/
