# Popover A trigger button and native popover panel for menu-like floating content. ## Usage Use standalone; the panel usually wraps `MenuList`. ```svelte ``` ## Anatomy The `class` attribute values represent part names. Other attributes represent their corresponding props. The panel usually wraps `MenuList`. ```svelte
{children}
``` Button trigger plus a `[popover]` panel, using the native Popover API and CSS Anchor Positioning only, with no JavaScript positioning fallback. `open` syncs both ways between programmatic state and native toggle events. `position`, `align`, `offset`, `matchWidth`, and `autoFlip` derive the native placement style; when `arrow` is enabled, a measurement effect reads the resolved trigger/panel rects on open, scroll, and resize so the rendered caret follows native flips and `data-svs-placement` exposes the resolved side, and `overflow: visible` is applied to the panel so the caret renders outside its box. `hover` adds pointer/focus opening only where the primary pointer can hover, otherwise it behaves like native click/focus opening. The component always provides `MenuContainerContext` so a nested `MenuList` can focus its first enabled item and close through the container. `manual` switches the panel to `popover="manual"` and disables native light-dismiss behavior. ## Props | Name | Type | Default | Description | |---|---|---|---| | `label*` | `Snippet` | - | Trigger label; receives open state and variant as arguments | | `children*` | `Snippet` | - | Panel content; receives the variant as its argument and usually renders a `MenuList` | | `open` | `boolean` | `false` | Bindable open state; can be observed and controlled | | `hover` | `boolean` | `false` | Opens on pointer enter and focus for hover-capable primary pointers | | `position` | `Position` | `"bottom"` | Native anchor placement position | | `align` | `Align` | `"start"` | Native anchor placement alignment | | `offset` | `number` | `0` | Gap from the anchor edge in px | | `autoFlip` | `boolean` | `true` | Enables native fallback placement | | `matchWidth` | `boolean` | `false` | Sets panel min-width to the anchor width | | `ariaRole` | `PopoverRole` | - | Sets the panel role, such as `menu`, `listbox`, or `dialog` | | `manual` | `boolean` | `false` | Uses `popover="manual"` and disables native light-dismiss behavior | | `arrow` | `boolean` | `false` | Renders the resolved placement caret part and sets `data-svs-placement`; also auto-applies `overflow: visible` to the panel so the caret can render outside | | `attach` | `Attachment` | - | Svelte attachment on the trigger | | `element` | `HTMLButtonElement` | - | Bindable trigger element | | `styling` | `SVSClass` | - | Styling override | | `variant` | `SVSVariant` | `NEUTRAL` | Popover variant | `*` required. Other `HTMLButtonAttributes` are passed to the trigger `