Popover

A floating panel anchored to a trigger. Reach for it to surface contextual content — details, forms, quick actions — without navigating away or dimming the page like a dialog. It closes on outside click or Escape. Anatomy: Popover (root, owns open state) wraps a PopoverTrigger (the anchor) and a PopoverContent panel that may contain a PopoverClose button.

A small panel

Unlike a Dialog it does not interrupt: the page stays live behind it and a click outside dismisses it. shadow-md is earned here — the panel renders over other content. It is also the one place focus-visible:outline-none is right: a ring around the whole panel says nothing the panel isn't already saying, and its controls keep their own.

Side and alignment

side picks the edge it anchors to and align where it sits along that edge; both flip automatically when there is no room. For a list of choices rather than a panel, give the container a small p-1p-0 reads as cramped against the rounded corners, and the default p-4 as bloated.

API

Popover

A floating panel anchored to a trigger. Reach for it to surface contextual content — details, forms, quick actions — without navigating away or dimming the page like a dialog. It closes on outside click or Escape. Anatomy: Popover (root, owns open state) wraps a PopoverTrigger (the anchor) and a PopoverContent panel that may contain a PopoverClose button.

Prop Type Default Description
children import('svelte').Snippet

Content rendered inside the root, typically a PopoverTrigger and PopoverContent.

open bindable boolean false

Bindable open state of the panel. Set to true to render it open by default.

onOpenChange (open: boolean) => void

Callback fired with the new boolean state whenever the panel opens or closes (forwarded via ...rest).

PopoverTrigger

The clickable anchor for a Popover; toggles the panel's open state. Place inside a Popover root.

Prop Type Default Description
children import('svelte').Snippet

Trigger content.

class string

Additional Tailwind classes merged onto the trigger element.

PopoverContent

The floating panel of a Popover, rendered near its trigger with an enter/exit scale transition. Place inside a Popover root, after a PopoverTrigger.

Prop Type Default Description
children import('svelte').Snippet

Panel content.

class string

Additional Tailwind classes merged onto the panel.

align 'start'|'center'|'end' 'center'

Alignment of the panel relative to the trigger's edge.

sideOffset number 4

Distance in pixels the panel is pushed from the trigger.

side 'top'|'right'|'bottom'|'left'

Edge of the trigger the panel anchors against (forwarded via ...rest).

PopoverClose

Dismisses the enclosing Popover when clicked. Place inside a PopoverContent.

Prop Type Default Description
children import('svelte').Snippet

Close control content.

class string

Additional Tailwind classes merged onto the element.