Popover API Playground

Your popovers on the Balai’s board open from popovertarget: click outside, press Esc, put them inside a box that clips its overflow, and see which stay open…

Why it matters

A proper popup is hard: z-index wars, clipped by overflow, forgetting to close on a click outside, focus going astray. The Popover API sorts it out in the browser: the top layer, light dismiss, Esc, a stack of nested menus, and the toggle event. Without one line of JS.

The key idea

An open popover lives in the top layer, and auto closes itself

Common mistakes

Try it in this playground