---
source: https://iinventedlight.com/library/notes/html-dialog.md
title: "HTML dialog: modal and non-modal pop-up boxes"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (web.dev); CC-BY-3.0 (web.dev); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: web.dev, Dialogs; web.dev, Dialogs (source). CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-3.0 (https://raw.githubusercontent.com/GoogleChrome/web.dev/main/LICENSE). Copyright Google LLC. Except as otherwise noted, the content of this site is licensed under the Creative Commons Attribution 3.0 License."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: html-dialog"
tags: [html, dialog, modal, inert, backdrop]
client: Librarian
sources:
  - id: S1
    title: "Dialogs"
    publisher: web.dev
    url: https://web.dev/learn/html/dialog
    accessed: 2026-11-26
    license: "CC-BY-4.0"
  - id: S2
    title: "Dialogs (source)"
    publisher: web.dev
    url: https://raw.githubusercontent.com/GoogleChrome/web.dev/main/src/site/content/en/learn/html/dialog/index.md
    accessed: 2026-11-26
    license: "CC-BY-3.0"
---
# HTML dialog: modal and non-modal pop-up boxes
**Answer:** The HTML dialog element can present a modal or non-modal pop-up box on a page.

## Modal and non-modal dialogs

A modal dialog is a special pop-up that interrupts the user and forces attention onto itself.

Users can interact only with content inside a modal dialog.

The rest of the page is set inert and, by default, sits behind a semi-transparent backdrop.

A non-modal dialog still allows interaction with content outside the dialog.

## Focus, opening, and closing

When a dialog opens, focus moves into the dialog.

Opening a modal dialog deactivates and obscures everything other than the dialog itself.

When a dialog is closed, focus returns to the element that opened it.

The Escape key does not close non-modal dialogs.

## See also

- [html-details](https://iinventedlight.com/library/notes/html-details/)
- [html-template](https://iinventedlight.com/library/notes/html-template/)
- [css-popover](https://iinventedlight.com/library/notes/css-popover/)

## Claims

- id: C1
  claim: A modal dialog interrupts the user as a special kind of pop-up.
  source: S1
  evidence: "interrupts the user on a web page"

- id: C2
  claim: Opening a modal deactivates and obscures the rest of the page.
  source: S1
  evidence: "Opening a modal dialog deactivates and obscures everything other than the dialog itself."

- id: C3
  claim: When a dialog opens, focus moves into it.
  source: S2
  evidence: "When the dialog is opened, focus moves into the dialog."

- id: C4
  claim: The Escape key does not close non-modal dialogs.
  source: S2
  evidence: "The escape key does not close non-modal dialogs."

## Sources

- [S1] Dialogs. web.dev. https://web.dev/learn/html/dialog . License: CC-BY-4.0. Accessed 2026-11-26.

- [S2] Dialogs (source). web.dev. https://raw.githubusercontent.com/GoogleChrome/web.dev/main/src/site/content/en/learn/html/dialog/index.md . License: CC-BY-3.0. Accessed 2026-11-26.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: web.dev, Dialogs; web.dev, Dialogs (source). CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. CC-BY-3.0 (https://raw.githubusercontent.com/GoogleChrome/web.dev/main/LICENSE). Copyright Google LLC. Except as otherwise noted, the content of this site is licensed under the Creative Commons Attribution 3.0 License. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
