Popover
moleculesFloating panel on the native Popover API: top layer, light dismiss, Escape, smart placement and a Button-compatible trigger.
Notification preferences
variant and count on the trigger; children receive { close } so a footer button can dismiss the panel.
Trigger chrome and placements
default ghost icon trigger; variant/tone/size/box/pill/control as on Button; placement is one of four corners.
Hover, link trigger, disabled and bound open
openOn="hover" adds pointer opening on fine pointers; as="a" href navigates and reveals; disabled; bind:open drives it from outside.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
placement | Placement | 'bottom-start' | |
gap | number | 6 | |
label required | string | — | Accessible name for the trigger. |
trigger required | Snippet | — | Trigger content (rendered inside a button that owns the popover wiring). |
children required | Snippet<[{ close: () => void }]> | — | Panel content. Receives `{ close }` to dismiss the panel from inside; zero-argument snippets keep working. |
triggerClass | string | '' | Extra class on the trigger button, for a stylesheet you already load globally. Your *scoped* CSS cannot reach it: the element is rendered by `Popover`, so it carries `Popover`'s scope hash, not yours, and a selector like `.toolbar .my-trigger` matches nothing. Use `style`, or a `:global(.pop-trigger)` descendant selector from your own root. |
bare | boolean | false | Drop the default ghost-icon chrome so the trigger is an unstyled button you fully own (pair with `triggerClass`). |
variant | TriggerVariant | — | Button-compatible trigger chrome. Omitting every chrome prop preserves the original ghost icon-button trigger. `toggle` renders the trigger as the `Toggle` chip itself, so a trigger and a Toggle side by side share one box — `size`, `pill` and `pressed` behave as they do on `Toggle`. |
pressed | boolean | false | `variant="toggle"` only: paint the chip in its "on" tint. |
tone | TriggerTone | 'none' | |
size | TriggerSize | — | |
box | 'xs' | 'sm' | 'md' | 'lg' | — | Shared square box scale (`--box-xs/sm/md/lg`) for an icon-only trigger, pinning the square exactly. The default trigger floors at the `sm` box and grows with its content; override that floor with `style="min-width: …; min-height: …"` for any other square. |
pill | boolean | false | Fully rounded trigger (`--r-pill`), as on `Button`. |
control | boolean | false | Uniform toolbar/composer control height; follows a sized `Cluster`. |
block | boolean | false | |
hitArea | 'auto' | 'compact' | 'auto' | Icon-only triggers grow a touch hit slab on coarse pointers; `compact` opts out. |
count | number | — | Corner count indicator on the trigger, as on `Button`: hidden at 0/undefined, capped at `countMax+`, the exact number joins `label`. |
countMax | number | 99 | |
disabled | boolean | false | |
openOn | 'click' | 'hover' | 'click' | `hover` adds pointer-driven opening on fine pointers; click, Enter and touch keep working so keyboard and touch users reach the same panel. |
hoverDelay | number | HOVER_OPEN_DELAY | Delay before a hover opens the panel. |
as | 'button' | 'a' | 'button' | Render the trigger as a link so it can navigate while still revealing the panel; an `a` without `href` toggles the panel like a button. |
href | string | — | |
role | PanelRole | 'dialog' | ARIA role of the panel. |
haspopup | HasPopup | 'dialog' | `aria-haspopup` announced on the trigger. |
open bindable | boolean | false | Bindable open state; setting it opens or closes the panel, even before its first open. |
onopen | () => void | — | |
onclose | () => void | — | |
class | string | '' | |
style | string | '' | |
panelClass | string | '' | Class / inline style on the floating panel. |
panelStyle | string | '' | |
sound | boolean | true | Play UI sounds when enabled globally; false silences this instance. |