RRezi UI

Popover

Floating panel for rich, interactive content anchored to a trigger, built on Radix Popover.

Fades and scales in from the trigger (150ms) and fades out in 100ms; under reduced motion it appears at once. Escape or a click outside closes it, and focus returns to the trigger.

Installation

npx shadcn@latest add @reziui/popover

The exit animation uses tw-animate-css, which shadcn init already imports into Tailwind v4 projects.

Usage

app/page.tsx
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";

export function Example() {
  return (
    <Popover>
      <PopoverTrigger asChild>
        <Button variant="secondary">Share</Button>
      </PopoverTrigger>
      <PopoverContent>…</PopoverContent>
    </Popover>
  );
}

Use a popover for content the user interacts with — a form, a link to copy, settings. For a short label on hover, use a Tooltip; for a list of actions, use a Dropdown Menu.

API reference

ComponentNotes
PopoverRadix Popover.Root: open, defaultOpen, onOpenChange, modal.
PopoverTriggerUse asChild to wrap your own button.
PopoverAnchorPositions the content against another element.
PopoverContent288px wide, 16px padding. side, align (default "center"), sideOffset (default 6).