Skip to content

Popover

A non-modal floating panel with focus management, Escape-to-close, and group coordination.

Styled with CSS Tailwind

Basic Popover

Click the button to open the panel. Focus moves into the panel automatically. Press Escape to close it and give the focus back to the button; a click outside closes it too, leaving the focus where you clicked. Unlike a Dialog, the rest of the page stays interactive.

Popover Group (mutual exclusion)

Wrap multiple popovers in a BitBhPopoverGroup so opening one automatically closes the others. Useful for navigation bars.

Controlled

Drive the open state externally with Open and OnOpenChange. The button below opens or closes the popover programmatically. The outside button carries data-bit-bh-dismiss-ignore: without it, pressing it would first dismiss the open surface as an outside press, and its click would then open it again.

Open: false

Anchor Positioning

Set Anchor on BitBhPopoverPanel to automatically position the panel relative to the button. The panel uses position: fixed, flips when there's not enough space, shifts to stay within the viewport, and auto-updates on scroll/resize. No position: relative on the parent or position: absolute on the panel needed.

Rich panel content

The panel can contain any content — forms, images, links, nested interactive elements. Tab navigates freely inside and out (no focus trap).

An unhandled error has occurred. Reload 🗙