Hover Card
A preview that appears when someone points at a link, so they can peek before they go.
When to use it
Use Hover Card to preview what’s behind a link: a person, a page, a repository. Everything in it must also be reachable by following the link.
Don’t put actions people need inside it; it disappears as soon as the pointer leaves.
Hover CardThis page
A peek at a link.
Previews of people and pages.
How it behaves
Base UI opens it after a short delay when the trigger is hovered or focused, and closes it when the pointer and focus leave. HoverCardTrigger renders a link; use render to style it, such as render={<Button variant="link" />}.
The content is supplementary. Put anything essential on the page or behind the link itself, because touch and keyboard users may never open the card.
HoverCardContent accepts side, align, and offsets, and matches Popover: overlay surface, a 150ms scale and fade from the trigger, immediate when opened from the keyboard.
Use Tooltip for a short label on an icon and Popover for content people interact with.
Build it
Add it with the shadcn CLI:
1pnpm dlx shadcn@latest add https://jzbui.com/r/hover-card.jsonA complete example. Change the values to fit your product:
1234567import { Button } from "@/components/ui/button"import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card"
<HoverCard> <HoverCardTrigger render={<Button variant="link" />}>Priya Nair</HoverCardTrigger> <HoverCardContent>Design lead · London</HoverCardContent></HoverCard>The full source is yours to edit once installed: