Popover
A floating popover with trigger-anchored transform origin, viewport collision flipping, directional scale reveal, and outside-click dismissal.
Customize
Installation
npx shadcn@latest add @kinetic/popoverUsage
import {
Popover,
PopoverContent,
PopoverDescription,
PopoverHeader,
PopoverTitle,
PopoverTrigger,
} from "@/components/kinetic/ui/popover";
export function Dimensions() {
return (
<Popover>
<PopoverTrigger>Open</PopoverTrigger>
<PopoverContent>
<PopoverHeader>
<PopoverTitle>Dimensions</PopoverTitle>
<PopoverDescription>Set the size of the layer.</PopoverDescription>
</PopoverHeader>
</PopoverContent>
</Popover>
);
}Side and alignment
Set side to top, bottom (default), left, or right, and align to start, center, or end. Use sideOffset to change the gap to the trigger in pixels. If there is not enough room, the popover flips to the opposite side and scales from the trigger.
<PopoverContent side="right" align="start" sideOffset={12}>...</PopoverContent>Custom anchor
Use PopoverAnchor (with optional asChild) to position PopoverContent against a separate element while keeping click, focus, and outside-dismiss behavior tied to PopoverTrigger.
import {
Popover,
PopoverAnchor,
PopoverContent,
PopoverTrigger,
} from "@/components/kinetic/ui/popover";
<Popover>
<div className="flex items-center gap-3">
<PopoverAnchor className="rounded-md border px-3 py-1.5 text-sm">
Stage 1440 x 900
</PopoverAnchor>
<PopoverTrigger>Edit</PopoverTrigger>
</div>
<PopoverContent>Anchored to the stage summary.</PopoverContent>
</Popover>Controlled state
Pass open and onOpenChange to control the popover, or defaultOpen for an uncontrolled initial state.
<Popover open={open} onOpenChange={setOpen}>
...
</Popover>Speed, blur, and intensity
speed scales the animation and blurPx sets the blur during the reveal. Set intensity to soft (default), strong, or dramatic to add velocity-driven stretch, staggered child entrance, a gradient sheen sweep, and a crisper exit spring. Add data-no-stagger to any direct child to opt it out of staggering.
<PopoverContent intensity="strong" speed={1.25}>...</PopoverContent>Dismissal
The popover closes on Escape and when you press outside the trigger and content, and also when the trigger scrolls out of view. Focus moves into the content on open and returns to the trigger on close; focus is not trapped.
Motion preferences
With reduced motion enabled, the popover appears and disappears instantly without the directional scale. Animation timing follows the current Kinetic tempo.
API Reference
Popover
Zero-dependency popover root controlling open state, trigger reference, and optional PopoverAnchor target.
| Prop | Type | Default | Description |
|---|---|---|---|
open / defaultOpen / onOpenChange | boolean / (open: boolean) => void | - | Controlled or uncontrolled open state. |
PopoverTrigger / PopoverAnchor
Interactive toggle trigger and optional custom positioning anchor element, both supporting asChild.
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Merges trigger or anchor props and refs onto the single child element. |
PopoverContent
Portaled floating surface anchored to PopoverAnchor when mounted or PopoverTrigger otherwise.
| Prop | Type | Default | Description |
|---|---|---|---|
side | "top" | "bottom" | "left" | "right" | "bottom" | Preferred placement side relative to the anchor. |
align | "start" | "center" | "end" | "center" | Cross-axis alignment along the anchor edge. |
sideOffset | number | 8 | Pixel spacing between anchor and popover surface. |
blurPx / speed | number | 4 / 1 | Entrance blur radius (px) and animation speed multiplier. |
intensity | "soft" | "strong" | "dramatic" | "soft" | Spatial presence intensity preset controlling spring overshoot, velocity stretch, staggered children, sheen sweep, and exit snap. |