Popover
Rich content in a portal, triggered by a button — compact hints, structured panels, and wide cards with an optional anchor arrow.
Installation#
pnpm dlx shadcn@latest add @davinciui/popoverUsage#
Composition: Popover → PopoverTrigger + PopoverContent (Portal + Positioner + Popup).
Positioning: Use align="start | center | end" and side="top | right | bottom | left" on PopoverContent.
RTL: Wrap with dir="rtl" — alignment flips automatically.
Composition#
Use the following composition to build a Popover:
Popover
├── PopoverAnchor
├── PopoverTrigger
└── PopoverContent
├── PopoverHeader
│ ├── PopoverTitle
│ └── PopoverDescription
└── PopoverCloseAPI Reference#
| Prop | Type | Default |
|---|---|---|
PopoverRoot. Controls open state. | Component | — |
PopoverTriggerButton that anchors the popover. Supports asChild. | Component | — |
PopoverContent · variantPanel density for hints, panels, and rich cards. | "default" | "compact" | "wide" | "default" |
PopoverHeader / Title / DescriptionStructured heading block for panels. | Component | — |
showArrowCaret pointing back at the trigger. | boolean | false |
PopoverContentPopup content. Props: align, side, sideOffset, showArrow. | Component | — |
alignAlignment relative to trigger. | "start" | "center" | "end" | "center" |
sideSide of trigger, with matching entrance motion. | "top" | "right" | "bottom" | "left" | "bottom" |
classNameAdditional CSS classes. | string | — |
Accessibility#
Base UI supplies trigger aria-expanded and aria-controls, dialog semantics, portal focus handling, Escape to close, and focus return. The wrapper adds no accessible name, so pass aria-label or render PopoverTitle inside.
Motion#
The popup animates 150ms ease-out opacity and scale from 95 percent with a side-dependent slide, driven by Base UI starting and ending data attributes. No timing props exist, and motion-reduce transition-none removes the animation.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

