base-ui-svelte

Popover

Displays rich content in a portal, triggered by a button.

View as Markdown

API Reference

Props mirror Base UI React where applicable, adapted for Svelte 5. Native HTML attributes for the rendered element are also accepted unless noted.

Popover.Root

Extends div HTML attributes.

PropertyTypeDefaultDescription
openboolean | undefinedWhether the component is open (controlled).
defaultOpenbooleanWhether the component is initially open (uncontrolled).
onOpenChange((open: boolean, eventDetails: { reason: OpenChangeReason }) => void) | undefinedEvent handler called when the open state changes.
openOnHoverboolean
delaynumberOpen delay when `openOnHover` is set (ms).
closeDelaynumberClose delay when leaving under hover (ms).
childrenSnippet<[{ open: boolean }]>Content rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-openPresent when the part is open.

Popover.Arrow

Extends span HTML attributes.

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-openPresent when the part is open.

Popover.Close

Extends button HTML attributes.

PropertyTypeDefaultDescription
renderstringHTML element tag to render instead of the default host element.
childrenSnippetContent rendered inside the part.

Popover.Description

Extends paragraph HTML attributes.

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.

Popover.Popup

Extends div HTML attributes.

PropertyTypeDefaultDescription
renderstringHTML element tag to render instead of the default host element.
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-ending-stylePresent while the exit animation can run.
data-openPresent when the part is open.
data-starting-stylePresent while the enter animation can run.

Popover.Portal

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.

Popover.Positioner

Extends div HTML attributes.

PropertyTypeDefaultDescription
sideSide
alignAlign
sideOffsetnumber
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-openPresent when the part is open.

Popover.Title

Extends heading HTML attributes.

PropertyTypeDefaultDescription
childrenSnippetContent rendered inside the part.

Popover.Trigger

Extends button HTML attributes.

PropertyTypeDefaultDescription
renderstringHTML element tag to render instead of the default host element.
disabledbooleanfalseWhether the control ignores user interaction.
openOnHoverboolean
childrenSnippetContent rendered inside the part.
Data attributeDescription
data-closedPresent when the part is closed.
data-disabledPresent when the part is disabled.
data-openPresent when the part is open.