Overlays
Popover
Floating panel anchored to a trigger, for pickers, small forms and details. Collision-aware and animated.
Installation
Install the package (React 19):
terminal
terminal
terminal
Import the styles once, in your app entry or root layout:
/src/main.tsx
Use it anywhere inside your app's <Theme> (see Installation):
/src/PopoverExample.tsx
Examples
Small form
Sides
Choose a preferred side; it flips when there is not enough room.
Static surface
A popover card without positioning or behavior.
Composition
anatomy.tsx
API Reference
Popover.Root
Holds the open state.
| Prop | Type | Default |
|---|---|---|
open | boolean | |
defaultOpen | boolean | false |
onOpenChange | (open: boolean) => void | |
modal | boolean | false |
Popover.Trigger
The element that toggles the popover.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | false |
Popover.Anchor
Optional element to position against instead of the trigger.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | false |
Popover.Content
The floating panel (portalled).
| Prop | Type | Default |
|---|---|---|
width | number | |
radius | "md""lg" | "md" |
side | "top""right""bottom""left" | "bottom" |
sideOffset | number | 4 |
align | "start""center""end" | "start" |
alignOffset | number | 0 |
avoidCollisions | boolean | true |
collisionPadding | number | Partial<Record<Side, number>> | 8 |
onEscapeKeyDown | (event: KeyboardEvent) => void | |
onPointerDownOutside | (event: PointerDownOutsideEvent) => void | |
onCloseAutoFocus | (event: Event) => void | |
forceMount | true | |
onOpenAutoFocus | (event: Event) => void |
Popover.Close
Closes the popover.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | false |
PopoverSurface
Static popover card.
| Prop | Type | Default |
|---|---|---|
width | number | |
radius | "md""lg" | "md" |
Accessibility
- Follows the WAI-ARIA dialog (non-modal) pattern: the content has
role="dialog"; the trigger hasaria-expandedandaria-controls. - Opening moves focus to the first focusable element inside; Tab moves within the page as usual.
- Escape, an outside click or
Popover.Closecloses it, and focus returns to the trigger. - Give content without a visible heading an
aria-label. - Collision-aware (8px from the viewport edges), never wider than the viewport minus 16px; scrolls when taller than the space left. Opens and closes with the shared motion layer (
styles/motion.css); withprefers-reduced-motion: reduceit only fades.
Usage
- Use for small, contextual tasks: rename, pick a date or color, adjust a filter.
- Use Menu for a list of actions and Tooltip for a short non-interactive hint.
- Use Dialog when the task needs full attention or has several steps.
© 2026 Motion. Internal documentation.