Prodular UI

Popover

A small floating panel anchored to a trigger for quick settings, sharing or filters that do not need a modal.

npx prodular-ui add popover

Share

A title, one control row and a setting below a hairline.

Filters

Set p-0 on the content and pad each section, so dividers run edge to edge.

Anatomy

<Popover>  <PopoverTrigger render={<Button variant="outline" />}>Share</PopoverTrigger>  <PopoverContent align="end">    <PopoverHeader>      <PopoverTitle>Share Q4 pricing review</PopoverTitle>      <PopoverDescription>Anyone in Halcyon with the link can view.</PopoverDescription>    </PopoverHeader>    {/* controls */}  </PopoverContent></Popover>

Guidance

Use it when

  • Use for a few related controls tied to one button: share settings, a filter, a date, a color.
  • Use PopoverHeader with PopoverTitle when the purpose is not obvious from the trigger.

Avoid

  • Lists of actions. Use Dropdown menu, which has keyboard navigation for items.
  • Help text on hover. Use Tooltip or Hover card.
  • Anything longer than about six controls. Use a Sheet or Dialog.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Open from PopoverTrigger with render={<Button variant="outline" />}.
  • Set align to match where the trigger sits: start for left aligned toolbars, end for buttons on the right.
  • Change width with a w-* class on PopoverContent. The default is w-72.
  • Use PopoverClose for buttons that should dismiss the popover, such as Apply.
  • Separate sections inside with border-t, never with nested cards.
  • For map markers, chart points and graph nodes, pass anchor={pointAnchor(x, y, container)} to PopoverContent and control open, instead of hand-positioning a div with popover classes.

API

PopoverContent

PropTypeDefaultDescription
side"top" | "right" | "bottom" | "left""bottom"Preferred side. Flips when there is no room.
align"start" | "center" | "end""center"Alignment against the trigger.
sideOffsetnumber6Gap to the trigger in px.
anchorElement | VirtualAnchor | RefObjectPositions against something other than the trigger: pointAnchor() for map markers, chart points and the pointer.
collisionPaddingnumber | Padding5Space kept from the viewport edge.
stickybooleanfalseKeeps the popup in view after the anchor scrolls away.

Popover

PropTypeDefaultDescription
modalboolean | "trap-focus"falseLocks page scroll and outside clicks when true.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add popover# or, with the registry in components.jsonnpx shadcn@latest add @prodular/popover

Used in these screens