coderef

PopoverBaseline · Newly available

The popover HTML attribute creates an overlay to display content on top of other page content. Popovers can be shown declaratively using HTML, or using the showPopover() method.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Jan 27, 2025.

Browser support

DesktopChrome
1–115Not supported
116+Supportedsince Aug 15, 2023
Current: 155
Edge
12–115Not supported
116+Supportedsince Aug 21, 2023
Current: 154
Firefox
1–124Not supported
125+Supportedsince Apr 16, 2024
Current: 157
Safari
1–16.6Not supported
17+Supportedsince Sep 18, 2023
Current: 27
MobileChrome Android
18–115Not supported
116+Supportedsince Aug 15, 2023
Current: 155
Firefox Android
4–124Not supported
125+Supportedsince Apr 16, 2024
Current: 157
Safari iOS
1–18.2Not supported
18.3+Supportedsince Jan 27, 2025
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Jan 27, 2025. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

HTML
<button popovertarget="menu">Open menu</button>

<div id="menu" popover>
  <a href="/profile">Profile</a>
  <a href="/logout">Log out</a>
</div>

<!-- Light-dismiss, top layer and Esc-to-close come for free. -->

Feature detection

JS · check before using
if ("HTMLElement" in globalThis && "popover" in HTMLElement.prototype) {
  // HTMLElement.popover is available
}

Sub-features

Support for each part of the feature (25). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLButtonElement.popoverTargetAction1141141251711412517
HTMLButtonElement.popoverTargetElement1141141251711412517
HTMLElement.beforetoggle_event1141141251711412517
HTMLElement.beforetoggle_event.popover_elements1141141251711412517
HTMLElement.hidePopover1141141251711412517
HTMLElement.popover1141141251711412518.3
HTMLElement.showPopover1141141251711412517
HTMLElement.showPopover.options_source_parameter1371371442613714426
HTMLElement.togglePopover1141141251711412517
HTMLElement.togglePopover.options_source_parameter1371371442613714426
HTMLElement.togglePopover.returns_boolean1161161251711612517
HTMLElement.toggle_event.popover_elements1141141251711412517
HTMLInputElement.popoverTargetAction1141141251711412517
HTMLInputElement.popoverTargetElement1141141251711412517
ToggleEvent1141141201711412017
ToggleEvent.ToggleEvent1141141201711412017
ToggleEvent.newState1141141201711412017
ToggleEvent.oldState1141141201711412017
backdrop.popover1141141251711412517
popover-open1141141251711412517
Show 5 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
button.popovertarget1141141251711412517
button.popovertargetaction1141141251711412517
input.popovertarget1141141251711412517
input.popovertargetaction1141141251711412517
popover1141141251711412517