Popover


Direction
Align
Palette
Elevation
Rounded
matchWidth
direction="right" + align="center"


Svelte
<script>
    let open = $state(false);
</script>

<Popover
    bind:open
    onclose={() => { open = false; }}
    palette="tone"
    rounded
    elevation="subtle"
    direction="bottom"
    align="start"
>
    {#snippet trigger()}
        <Button onclick={() => { open = !open; }}>
            Open popover
        </Button>
    {/snippet}

    {#snippet children()}
        <p>Popover content here</p>
    {/snippet}
</Popover>

API


package_2

import type { PopoverPalette, PopoverElevation, PopoverDirection, PopoverAlign } from '@abhc/spektral-ui';
PropTypeDefault
openbooleanfalse
onclose() => void—
direction"top" | "bottom" | "left" | "right""bottom"
align"start" | "center" | "end""start"
gapstring"6px"
maxHeightstring"320px"
widthstring—
matchWidthbooleanfalse
palette"tone" | "accent" | "accentbg""tone"
roundedbooleanfalse
elevation"none" | "subtle" | "hard""none"
triggerSnippet—
childrenSnippet—
Prop open
Type boolean
Default false
Prop onclose
Type () => void
Default —
Prop direction
Type "top" | "bottom" | "left" | "right"
Default "bottom"
Prop align
Type "start" | "center" | "end"
Default "start"
Prop gap
Type string
Default "6px"
Prop maxHeight
Type string
Default "320px"
Prop width
Type string
Default —
Prop matchWidth
Type boolean
Default false
Prop palette
Type "tone" | "accent" | "accentbg"
Default "tone"
Prop rounded
Type boolean
Default false
Prop elevation
Type "none" | "subtle" | "hard"
Default "none"
Prop trigger
Type Snippet
Default —
Prop children
Type Snippet
Default —