Popover
Open contextual content next to a trigger.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/popoverComplete the one-time setup first. Registry JSON lists source files and dependencies.
For this page’s examples, also install:
pnpm dlx shadcn@4.18.0 add @siteplane/button @siteplane/form @siteplane/input @siteplane/input-group @siteplane/textareaField is installed with Input.
Usage
import { Button } from "@/siteplane/components/button";
import {
Popover,
PopoverTrigger,
PopoverPopup,
PopoverTitle,
PopoverDescription,
} from "@/siteplane/components/popover";
<Popover>
<PopoverTrigger render={<Button variant="outline" />}>Status</PopoverTrigger>
<PopoverPopup>
<PopoverTitle>Project status</PopoverTitle>
<PopoverDescription>On track for the October release.</PopoverDescription>
</PopoverPopup>
</Popover>;Composition
Popover
├── PopoverTrigger
└── PopoverPopup / PopoverContent
├── PopoverTitle
├── PopoverDescription
└── PopoverCloseClose button
Set showCloseButton on PopoverPopup for a close button in the top-end corner, the same one Dialog, Sheet and Drawer use. The first block of the content keeps clear of it. Use PopoverClose for any other close action, such as a Done button. Escape and clicks outside the popover also close it.
Alignment
Use align to line the popover up with the start (default), center or end of its trigger. side sets the preferred side; the popover flips when there isn’t enough room.
Tooltip style
Set tooltipStyle when an info button only reveals a short hint. Unlike a tooltip, the popover also opens on click or tap; openOnHover on the trigger opens it on hover as well.
Glass
Set variant="glass" when the popover opens over a photo, a video or a color surface. The popup then shows a tinted, blurred view of what lies behind it; its padding and parts stay the same. Glass shows every component with a glass variant.
The gradient only makes the glass visible. It is not part of the component.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
Popover | top | right | bottom | left | inline-start | inline-end | bottom | Preferred side. |
Popover | start | center | end | start | Alignment. |
Popover | number | 4 | Gap from anchor. |
Popover | number | 0 | Alignment offset. |
Popover | default | glass | default | glass shows a tinted, blurred view of what lies behind the popup. |
Popover | boolean | false | Small tooltip-like visual surface. |
Popover | compact | default | default | Viewport padding profile. |
Popover | Positioner anchor | trigger | Custom anchor. |
Popover | boolean | false | Renders a close icon action in the top-end corner; the first content block keeps clear of it. |
Popover | PopoverPrimitive.Close.Props | unset | Overrides the built-in close action, including aria-label (default: Close). |
Popover | PopoverPrimitive.Portal.Props | unset | Portal configuration. |
Popover | boolean | false | Also opens the popover on hover. |
open / default | boolean | false | Visibility. |
on | (open, eventDetails) => void | unset | Visibility callback. |
on | (open) => void | unset | After motion completes. |
Popover is the foundation Root. Trigger, Close, Title and Description wrap the
corresponding parts. Popup includes Portal, Positioner, Viewport and the
optional close button; PopoverContent aliases Popup. PopoverCreateHandle
creates a detached-trigger handle; PopoverPrimitive exports the namespace.
Styled parts accept string className. Popup focus and Root interaction options
follow Base UI Popover; the
wrapper only forwards the listed positioner options, not arbitrary positioner
props.
Usage notes
Use Escape to dismiss and preserve focus restoration. Put fields and buttons in a popover rather than in a Tooltip, whose content cannot be reached with the keyboard. The popup carries the Siteplane UI provider settings into its portal, so no additional provider is required.