humanonlyweb/ui

Popover

A non-modal panel anchored to a trigger.

Markdown

Examples

Basic

Copy code

API

PropTypeDefault
label*

Accessible name for the panel (role="dialog").

string—
align

Which trigger edge the panel lines up with. Flips automatically near the viewport edge.

"end" | "start""start"
open

Whether the panel is open.

booleanfalse
EventPayload
update:open

v-model:open update.

[value: boolean]
SlotProps
trigger

The trigger. Bind attrs to a <button>.

{ isOpen: boolean; attrs: Record<string, unknown>; }
default

Panel content. Mounted on first open.

{ close: () => void; }

Styling

Parts
popover-anchorpopover
States
data-popover-align

Keyboard

KeysAction
Enter / SpaceToggle
EscapeClose and return focus to the trigger
TabMove through the panel; leaving it closes it

Accessibility

  • Focus moves into the panel on open.