Popover
Floating content panel anchored to a trigger
Start Here
Start from the smallest working snippet, then move to interactive examples and the full API contract below.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { Popover } from '@dryui/ui';
</script>
<Popover.Root bind:open={popoverOpen}>
<Popover.Trigger>
<Button variant="outline">Info</Button>
</Popover.Trigger>
<Popover.Content>
<p>Popover details here.</p>
</Popover.Content>
</Popover.Root>Import options
Root package
import { Popover } from '@dryui/ui'Per-component subpath
import { Popover } from '@dryui/ui/popover'Customize
Use the interactive examples to see common variants, states, and composition patterns before building your own.
Basic Popover
Popover content. This floats above the page anchored to the trigger.
<Popover.Root>
<Popover.Trigger>
<Button variant="outline">Open Popover</Button>
</Popover.Trigger>
<Popover.Content>
<p>Popover content. This floats above the page anchored to the trigger.</p>
</Popover.Content>
</Popover.Root>Popover with offset
Popover with a 12px offset from its trigger element.
<Popover.Root>
<Popover.Trigger>
<Button variant="outline">Open Popover</Button>
</Popover.Trigger>
<Popover.Content offset={12}>
<p>Popover with custom offset from trigger.</p>
</Popover.Content>
</Popover.Root>Structure
Compound components always start with Popover.Root. Use this structure block to understand required wrappers before you wire state or styling.
Popover.Root Popover.Trigger Popover.Content
Compose
The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.
Compound component. Start with Popover.Root, then add only the parts you need.
Popover.Root
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
open | boolean | false | — | ✓ |
children | Snippet | — | ✓ | — |
Also accepts standard HTML attributes (class, style, id, etc.)
Popover.Trigger
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
Popover.Content
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
offset | number | — | — | — |
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.