Overlays Core Stable

Popover

An anchored panel that opens next to a trigger and holds interactive content — quick settings, a small form, more than a tooltip can carry

Preview

Installation

pnpm add fancy-ui-svelte
import { Popover } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { Popover } from 'fancy-ui-svelte';
</script>

<Popover />

Examples

Basic Usage

A Dimensions panel with two labelled fields, matching the mockup.

Sides

The panel placed on each of the four sides.

With Form

An interactive form inside the panel, closing itself on submit — bind:open plus focus-trapped input and button.

Props

PropTypeDefaultDescription
open booleanfalseWhether the panel is open. Bindable
onOpenChange (open: boolean) => void-Called with the new value whenever the panel opens or closes, however the change happened
side "top" | "bottom" | "left" | "right""bottom"Side of the trigger to place the panel on. Flips when it would overflow
align "start" | "center" | "end""center"Alignment along the trigger's cross axis
offset number8Gap in pixels between the trigger and the panel
dismissible booleantrueWhether Escape and an outside click close the panel
class string-Additional CSS classes, merged onto the panel
ref HTMLDivElement | nullnullBindable reference to the panel element

Slots

SlotDescription
triggerThe trigger's content, rendered inside the real <button> this component owns and wires up
childrenThe panel's content