Prodular UI

Hover card

A preview card that appears when hovering or focusing a link, for people, issues or pull requests mentioned in text.

npx prodular-ui add hover-card

Person

Name, role and the two facts that matter right now.

Assigned to Priya Raman since Monday.

Anatomy

<HoverCard>  <HoverCardTrigger href="/people/priya">Priya Raman</HoverCardTrigger>  <HoverCardContent>    {/* avatar, name, role */}  </HoverCardContent></HoverCard>

Guidance

Use it when

  • Use to preview a person, issue, pull request or document mentioned inline, so people do not have to open it.
  • Keep it to a title, a subtitle and two or three facts.

Avoid

  • Content people must interact with to finish a task. Hover cards do not open on touch.
  • Short labels for icon buttons. Use Tooltip.

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.

  • HoverCardTrigger renders a link. Give it a real href so it works without hover.
  • Never put the only copy of important information in a hover card.
  • Separate the header from details with border-t pt-3, not with a nested box.
  • Use side="top" when the trigger sits near the bottom of a scroll area.
  • For map markers, chart points and graph nodes, pass anchor={pointAnchor(x, y, container)} to HoverCardContent and control open, instead of hand-positioning a div with popover classes.

API

HoverCard

PropTypeDefaultDescription
delay / closeDelaynumber600 / 300Milliseconds before opening and closing.

HoverCardContent

PropTypeDefaultDescription
side"top" | "right" | "bottom" | "left""bottom"Preferred side.
align"start" | "center" | "end""center"Alignment against the trigger.
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.

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 hover-card# or, with the registry in components.jsonnpx shadcn@latest add @prodular/hover-card