Page:
Popover
Pages
Accordion
AccordionItem
Alert
Avatar
Badge
BarChart
Button
ButtonGroup
Card
Changelog
ChartLegend
Checkbox
CodeEditor
Collapsible
Combobox
CommandPalette
ContextMenu
CopyButton
DatePicker
Dialog
DonutChart
Drawer
Field
FileInput
FileList
Forms
Gauge
Getting started
Heatmap
Home
Image
InlineEdit
Input
Kbd
Label
LineChart
Menu
MultiSelect
NumberInput
Overlays
Pagination
Popover
Progress
RadioGroup
Scroller
Select
Separator
ShareBar
Sheet
Skeleton
Slider
Sparkline
Spinner
StatCard
Switch
Table
Tabs
TagsInput
Textarea
Theming
Toaster
Toggle
Tooltip
Tree
No results
3
Popover
L4stIdi0t edited this page 2026-09-09 00:02:12 +02:00
Popover
A floating panel anchored to its trigger — the generic surface Menu and Select are specialisations of.
Use it for a filter panel, a colour picker, a "why is this disabled?" explainer: anything that is content rather than a list of commands. The trigger comes in as a snippet and receives the props to spread, so aria-expanded and aria-controls land on YOUR button — the same shape as Tooltip.
<Popover>
{#snippet trigger(props)}<Button {...props}>Filters</Button>{/snippet}
{#snippet children()}…{/snippet}
</Popover>
Overlays · two-way: bind:open · portalled to <body> · keyboard contract
<script lang="ts">
import { Popover } from '@l4st/driftwood';
</script>
| Light | Dark |
|---|---|
![]() |
![]() |
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
open bind: |
boolean |
false |
Opening moves focus into the panel; closing returns it to the trigger. |
side |
Side |
'bottom' |
Preferred side of the trigger. Flips if it does not fit. |
align |
Align |
'start' |
Alignment along the trigger's cross axis. |
class |
string |
— | Merged with the component's own classes, last — so yours win. |
aria-label |
string |
— | Names the panel for assistive tech. |
onOpenChange |
(open: boolean) => void |
— | Fires on open and on close, however it was dismissed. |
trigger required |
Snippet<[Record<string, unknown>]> |
— | Your button. Spread the props it receives to get aria-expanded and the click handler. |
children required |
Snippet |
— | The content. |
Keyboard
| Key | Does |
|---|---|
| Enter / Space | open from the trigger; focus moves into the panel |
| Escape | close, focus returns to the trigger |
Overlays · Dialog · Sheet · Drawer · Tooltip
driftwood
Layout
Actions
Forms
- Field
- Input
- FileInput
- FileList
- Textarea
- CodeEditor
- Combobox
- RadioGroup
- NumberInput
- InlineEdit
- Label
- Select
- MultiSelect
- DatePicker
- TagsInput
- Checkbox
- Switch
- Slider
Feedback
Charts
Overlays
Navigation
Generated from the source by pnpm wiki · repository · v0.24.0

