Skip to main content

Popover

A floating popover with trigger-anchored transform origin, viewport collision flipping, directional scale reveal, and outside-click dismissal.

100% x 48px·bottom / center

Customize

Side offset (px)8
Motion blur (px)4
Speed1

Installation

npx shadcn@latest add @kinetic/popover

Usage

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.

PropTypeDefaultDescription
open / defaultOpen / onOpenChangeboolean / (open: boolean) => void-Controlled or uncontrolled open state.

PopoverTrigger / PopoverAnchor

Interactive toggle trigger and optional custom positioning anchor element, both supporting asChild.

PropTypeDefaultDescription
asChildbooleanfalseMerges trigger or anchor props and refs onto the single child element.

PopoverContent

Portaled floating surface anchored to PopoverAnchor when mounted or PopoverTrigger otherwise.

PropTypeDefaultDescription
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.
sideOffsetnumber8Pixel spacing between anchor and popover surface.
blurPx / speednumber4 / 1Entrance 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.

Notes

Use Popover for interactive click-triggered controls; use HoverCard for passive previews and Tooltip for short text hints. Note that PopoverTitle accepts h2 props but renders a div element.