stnd.build

Popover

An anchored, non-modal popup for forms and controls. The trigger snippet receives the native-button attributes to spread on ONE button (no nested button wrapper); focus moves into the popup when it opens and returns to the trigger when it closes. A click outside closes it.

argument on it.

Defaults to “start”.

“bottom”.

Type Name Description
boolean open? Whether the popup is open. Bindable.
string label Accessible name of the popup.
import(‘svelte’).Snippet<[object]> trigger Renders the button; spread the
import(‘svelte’).Snippet children? The popup content.
“start” | “end” align? Which edge of the trigger the popup lines up with.
“bottom” | “top” side? Which side of the trigger it opens on. Defaults to
string class? Extra classes on the root.
() => void onclose? Called when the popup closes.
<Popover bind:open label="Filters">
  {#snippet trigger(attrs)}<button {...attrs}>Filters</button>{/snippet}
  <form>…</form>
</Popover>