Hover Card

A preview that appears when someone points at a link, so they can peek before they go.

Reviewed by yesterday.

Hover or focus the name to preview the profile.

Fig. 1 Point at the name to preview the profile. Keyboard focus opens it too.

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.

Tooltip

Names a control.

Press to try the action.

Icon buttons and unlabeled controls.

Hover CardThis page

A peek at a link.

Reviewed by yesterday.

Hover or focus the name to preview the profile.

Previews of people and pages.

Popover

The page stays usable.

Press Esc or click outside to close.

Small changes next to their button.

Fig. 2 Three ways to show more on demand. Point at or focus each one.

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:

Terminal

A complete example. Change the values to fit your product:

hover-card-example.tsx

The full source is yours to edit once installed:

hover-card.tsx