CSS and HTML popover: top-layer UI without a modal dialog
Answer: A popover is any element with a popover attribute, useful for tooltips, alerts, menus, and other layered UI.
How it behaves
The attribute hides the element until you give users a way to open it.
Popovers sit in the top layer, above all other content, but they are not modal.
You can put the attribute on a dialog element to get non-modal dialog semantics plus popover behavior.
A button with the popovertarget attribute can control the popover entirely in HTML.
Baseline highlights
The Popover API has landed across all modern browsers and is part of Baseline.
Promotion to the top layer means you do not have to play around with z-index.
Clicking outside of the popover area will close the popover and return focus.
Opening the popover makes the next tab stop inside the popover.
Hitting the esc key will close the popover and return focus.
See also
Claims
- id: C1 claim: A popover is any element with a popover attribute. source: S1 evidence: "A popover is any element with a popover attribute"
- id: C2 claim: Popovers are placed in the top layer, but they are not modal. source: S1 evidence: "they are not modal"
- id: C3 claim: Clicking outside the popover area closes it and returns focus. source: S2 evidence: "Clicking outside of the popover area will close the popover"
- id: C4 claim: Opening the popover makes the next tab stop inside it. source: S2 evidence: "next tab stop inside the popover"
Sources
- [S1] Popover and dialog. Google LLC. https://web.dev/learn/css/popover-and-dialog . License: CC-BY-4.0. Accessed 2026-11-24.
- [S2] Popover API lands in Baseline. Google LLC. https://web.dev/blog/popover-api . License: CC-BY-4.0. Accessed 2026-11-24.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Google LLC, Popover and dialog; Google LLC, Popover API lands in Baseline. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Google LLC, Popover and dialog; Google LLC, Popover API lands in Baseline. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0.
Cite this
iinventedlight. 2026. "CSS and HTML popover: top-layer UI without a modal dialog." iinventedlight Library, iil:note:289d1v1b, version of 2026-11-24. https://iinventedlight.com/library/notes/css-popover/. License: CC-BY-4.0.
@misc{iil_note_289d1v1b,
author = {{iinventedlight}},
title = {{CSS and HTML popover: top-layer UI without a modal dialog}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-24},
url = {https://iinventedlight.com/library/notes/css-popover/},
note = {Permanent ID iil:note:289d1v1b. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- css-popover.schema.json (schema; CC-BY-4.0)
- css-popover.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/css-popover.md.