Favorites

HTML popover Global Attribute

popover
HTML Global AttributeThis global attribute is supported by all modern browsers.
Updated 22nd November 2026

The popover attribute turns an element into a popover, hidden until it is opened and then shown above the rest of the page in the top layer.

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee

Description

The popover attribute is a global attribute that turns any element into a popover: content that is hidden by default and, when shown, is displayed in the top layer, above all other content, without any z-index or positioning tricks. It is used for menus, tooltips, pickers, toast notifications and other floating UI.

A popover element is hidden until it is opened. It can be opened and closed without JavaScript by a button that points to its id with the popovertarget attribute (or commandfor with command="toggle-popover"), or with the JavaScript methods showPopover(), hidePopover() and togglePopover().

Example
<button popovertarget="info">More info</button>

<div id="info" popover>
  <h3>Product details</h3>
  <p>This product is made from eco-friendly materials.</p>
</div>
Behavior
  • popover or popover="auto": the popover can be light dismissed by clicking outside it or pressing Esc, and opening it closes other auto popovers that are not its ancestors.
  • popover="manual": the popover is only closed explicitly, by a button or JavaScript, and several can be open at once.
  • popover="hint": for tooltips. It is light dismissed like auto, but opening it does not close open auto popovers; it only closes other hints.
  • The browser fires the beforetoggle and toggle events when the popover opens or closes, and the :popover-open pseudo-class matches it while it is shown.
  • By default, popovers are centered in the viewport. Use CSS anchor positioning to place a popover next to the button that opens it.
Key Notes
  • When opened by a popovertarget button, the browser connects the two for accessibility and returns focus to the button when the popover is light dismissed.
  • A popover is not modal: the rest of the page stays interactive. Use a <dialog> opened with showModal() when the user must respond before continuing.

Syntax

<div id="my-popover" popover="auto | manual | hint"></div>

Values

  • autoThe default, also used when the attribute has no value. The popover can be light dismissed, and opening it closes other auto popovers.
  • manualThe popover must be closed explicitly with a button or JavaScript. It does not close other popovers.
  • hintFor tooltips: light dismissed, and does not close open auto popovers. Supported in Chrome and Edge 151, Firefox 153 and Opera 135, but not yet in Safari.

Example

<button popovertarget="confirm-popup">Delete Account</button>

<div id="confirm-popup" popover="manual">
<p>Are you absolutely sure?</p>
<button popovertarget="confirm-popup" popovertargetaction="hide">Cancel</button>
</div>
Open in editor

Browser Support

The following information will show you the current browser support for the HTML popover global attribute. Hover over a browser icon to see the version that first introduced support for this HTML global attribute.

This global attribute is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee