Duolith docs

Popover

Content that opens next to its trigger, above the screen but not modal, flipping and shifting to stay in the window.

Stability: experimental

Props

PropTypeDefaultMeans
labelstringThe popover's accessible name.
openbooleanbindable(false)Whether the popover shows. The trigger piece toggles it; Escape or a press outside clears it.
placement"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end"bottomWhich side of the trigger it prefers, and how it lines up with it.

Pieces

PieceMeans
triggerThe control that opens the popover.

Children

The popover's content.

States

StateLooks like
openA surface panel up to 320px wide, with a border, a large radius and shadow, 6px from its trigger.
flippedOn the other side of the trigger when the preferred side has no room; shifted along to keep 8px from the window's edges.
openingFades and slides 4px towards its side, in 140 ms; at once with reduced motion.

Accessibility

roledialog, not modal
nameThe label prop (aria-label).
focusOn open, focus moves to the first focusable element inside, else the popover itself. The page stays usable. On close, focus returns to the trigger.
keyboardEscape closes it.
notesThe trigger carries aria-haspopup="dialog", aria-expanded and aria-controls.

Theme tokens

color.surface color.ink color.border shadow.lg radius.lg space.3 space.4

Example

<Popover label="About"><piece name="trigger"><Button label="Details" variant="ghost" /></piece><text>Posted today</text></Popover>