A modern, accessible, lightweight UI component library for Svelte.
GETTING STARTED
COMPONENTS
INFRASTRUCTURE
Popover
Content that floats abover other content
Code
<script lang="ts">
import { Popover } from '@geoffcox/sterling-svelte';
let reference: HTMLElement;
</script>
<div bind:this={reference}>The reference anchor for positioning the popover.</div>
<Popover open {reference}>
sterling-svelte
</Popover>
Members
Property Name
Type
Default
Comment
conditionalRender
boolean
true
When true, content is rendered only when the popover is open.
crossAxisOffset
number
0
The offset along the side of the reference element.
mainAxisOffset
number
0
The offset towards or away from the side of the reference element.
open
boolean
false
When true, the popover is open and visible.
placement
PopoverPlacement
'bottom-start'
How the popover should be positioned relative to the reference element.
portalHost
HTMLElement | undefined
undefined
The host container for the callout.
reference
HTMLElement | undefined
undefined
The reference to the element anchoring the position of the popover.