Popover and modal dialog
Shows overlays on top of everything on the page using the top layer.
In one line
Can show a box over everything else on the page
Shows overlays on top of everything on the page using the top layer.
A site can draw modal dialogs and popovers above all other content, including iframes. They are page content, not browser UI, so well made fakes can mimic prompts.
What it can and can't do
What the user does: Nothing for most boxes. It happens when you tap a menu, a help bubble or Open details.
It can
- Show a menu, tooltip or confirm box on top of the page
- Dim and lock the page behind a modal box until you close it
- Close the box when you press Esc or tap outside
It cannot
- Cover things outside its own page, like the address bar or other tabs
- Stop you leaving the tab or closing the browser
- Show over another app on your phone or computer
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 114 | 2023-05-30 | None |
| Edge | Supported | 114 | 2023-06-02 | None |
| Firefox | Supported | 125 | 2024-04-16 | None |
| Safari | Supported | 17 | 2023-09-18 | None |
| Safari on iPhone | Supported | 17 | 2023-09-18 | All iOS browsers use WebKit |
| Chrome on Android | Supported | 114 | 2023-05-30 | None |
| Samsung Internet | Supported | 23.0 | 2023-10-18 | None |
How a site asks for it
| API | <dialog>.showModal(); popover attribute; showPopover(); closedby |
| Browser compat keys | api.HTMLElement.showPopoverapi.HTMLDialogElement.showModal |
| How access is granted | none |
| What the user sees | None (no browser prompt) |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| Activation | none |
| How long it lasts | While open |
| How to take it back | Nothing to revoke (no permission is stored) |
| Inside an iframe | Top layer belongs to each document; cannot cover browser UI |
Typical flow
- Page calls showModal() or showPopover()
- Element enters top layer
- Light dismiss closes popovers
Data you get
Shape: none
No individual data fields. The signal is the access itself.
Technical limits
- No activation required to show a dialog or popover (activation required for fullscreen only)
- Cannot draw outside the viewport or over the address bar and permission bubbles
- popover=auto uses light dismiss; popover=manual does not
- Support: dialog Chrome 37, Safari 15.4, Firefox 98; popover Chrome 114, Safari 17, Firefox 125
The story
What it is
A page can put a box on top of everything, using built in browser tools.
For you
Menus, tooltips and 'accept cookies' boxes sit neatly on top of the page, and keyboard and screen readers handle them better than home made versions.
For makers
Makers replace fragile custom code with built in pieces. It means fewer bugs, better accessibility and lighter pages, and it standardizes how consent banners and menus work.
Where you see it
| Type | Example | Apps |
|---|---|---|
| shopping | A product page opens a size chart as a modal that dims the page behind it. | Nike, Zara |
| ads | A cookie consent banner is drawn on top of the whole page by the site. | None named |
| accessibility | A modal traps keyboard focus so someone using a screen reader cannot tab behind it. | None named |
| games | A browser game shows a pause menu on top of the playing field. | None named |
| productivity | A dropdown menu in a web app pops open above the rest of the page. | GitHub, Notion |
| social | A photo viewer opens a lightbox over a feed. | Instagram web |
Risks
- Consent banner tricks
- Layering abuse
What the platform says
- Google: Popover API. Chrome's blog says the Popover API lets developers show floating content above the rest of the page with little code.
Good uses and abuse
Legitimate uses
- Modal forms
- Menus and tooltips
Known abuse
- Fake browser permission dialogs drawn inside the page
- Overlay phishing
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 5 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2023-05, Chrome 114: Popover API ships
- 2023-09, Safari 17: Popover API ships
- 2024-04, Firefox 125: Popover API ships
Sources
How well checked: Based on official documentation.