Skip to content

API reference

The full Popover surface: props, the two-way open model, the change event, the imperative handle, and the slots. For the per-framework consumption code see the usage page.

Props

The full prop surface. The single model: true slice (open, the Two-way column) is an optional two-way r-model with an uncontrolled fallback.

NameTypeDefaultTwo-way (model)RequiredDescription
openBooleanfalseWhether the floating content is open. The sole model: true prop — two-way bind it (r-model:open / v-model:open / bind:open / [(open)]) and Popover writes the new state back whenever the trigger or a dismissal toggles it. Left unbound it falls back to an uncontrolled default.
placementString"bottom"Floating UI placement of the content relative to the anchor — one of top/right/bottom/left, each optionally suffixed -start/-end (e.g. bottom-start). With disableFlip off, the content may flip to the opposite side when it would overflow the viewport. Reconciled at runtime.
triggerString"click"How the anchor opens the content: 'click' toggles on click, 'hover' opens on pointer-enter and closes on pointer-leave (tooltip-style), 'focus' opens on focus and closes on blur. Drives both the gesture handlers and the ARIA role ('hover'/'focus' → tooltip, 'click' → popover dialog).
offsetNumber8Distance in pixels between the anchor and the floating content (the Floating UI offset middleware). Reconciled at runtime.
disableFlipBooleanfalseDisable the Floating UI flip middleware. By default the content flips to the opposite side of the anchor when it would overflow the viewport; set this to keep it pinned to placement regardless.
disableShiftBooleanfalseDisable the Floating UI shift middleware. By default the content shifts along its axis to stay within the viewport; set this to keep it strictly aligned to the anchor.
arrowBooleanfalseOpt in to a positioned arrow element. When set, Popover renders an arrow <div> and runs the Floating UI arrow middleware against it so it points at the anchor. Style it via the --rozie-popover-* arrow CSS custom properties.
disabledBooleanfalseDisable the control entirely: the trigger no longer opens the content and any open content is suppressed.

Models (the two-way open state)

open is the one model: true prop — a boolean, where true shows the floating content. Two-way bind it (r-model:open / v-model:open / bind:open / [(open)]) and the component writes the new state back whenever the trigger gesture or a dismissal toggles it. Left unbound it falls back to an uncontrolled default.

Model (r-model:)ShapeChange eventDescription
openbooleanchangeWhether the floating content is shown. Written back on every trigger gesture (click/hover/focus), Escape / click-outside dismissal, or programmatic show/hide/toggle.

Events

EventDescription
changeFired whenever the open state changes. Payload is the new open boolean. Named changenot open — so the two-way model and its change notification do not collapse onto one name (the MapLibre model-prop==emit-name lesson).

Imperative handle

Declared once via $expose; obtained through each framework's native ref mechanism.

MethodDescription
showOpen the floating content (no-op when disabled). Emits change.
hideClose the floating content. Emits change.
toggleFlip the open state (no-op when disabled). Emits change.
repositionRecompute the floating position immediately (computePosition). Named reposition, not update, because update is a reserved Lit ReactiveElement lifecycle method.

Slots

SlotParamsDescription
anchor{ open, toggle, show, hide }The trigger element. The scoped params expose the open state and the open/close verbs so you can build any trigger (a <button>, an icon, etc.) and the gesture handlers wire automatically per trigger.
(default)The floating content. Mounted only while open (and not disabled); Floating UI positions it relative to the anchor.

Pre-v1.0 — internal monorepo.