← All Tools

HTML Popover Builder

Generate native HTML popovers — popover="auto" | "manual" | "hint", popovertarget triggers, anchor positioning, ::backdrop styling, and @starting-style entry animation. Zero JS required for show/hide, but a programmatic .showPopover() example is included too.

Checking popover support…

Type

Trigger button

Popover content

Styling

Live preview

Anchor positioning needs anchor-name + position-anchor support (Chrome 125+, Edge 125+). Falls back to position: fixed centered otherwise.

HTML


  

CSS


  

Reference

The three popover types
TypeLight-dismissEsc closesStacksUse for
auto (default)Yes — click outside closes.Yes.Closes peers in the same stack.Menus, dialogs, picker UIs.
manualNo.No.Independent — many can be open.Toasts, persistent panels.
hintYes.Yes.Separate "hint stack" — closes other hints but not autos.Tooltips, hover help.
JavaScript API
Method / eventWhat
el.showPopover()Open it.
el.hidePopover()Close it.
el.togglePopover(force?)Toggle, with optional forced state.
el.matches(':popover-open')Is it open?
beforetoggleCancellable event before state changes (.newState = 'open' / 'closed').
toggleFires after the state has changed.
Browser support & fallbacks
  • popover attribute: Chrome 114+, Edge 114+, Safari 17+, Firefox 125+ — broadly available.
  • Anchor positioning (anchor-name, position-anchor, anchor()): Chrome 125+, Edge 125+. Use @supports (anchor-name: --a) to gate.
  • @starting-style for entry animation: Chrome 117+, Safari 17.5+, Firefox 129+.
  • Polyfill: oddbird/popover-polyfill covers the attribute & JS API in older browsers.