Skip to content

Hover Card

Free

A card that opens when people point at a link or tab to it. It shows a preview, such as a profile or a page, so they need not leave.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Put the link in HoverCardTrigger and the preview in HoverCardContent.

mention-preview.tsx

HoverCard

PropTypeDefaultDescription
From Base UIPreviewCard.RootBase UI docs
defaultOpenbooleanfalseWhether the preview card is initially open. To render a controlled preview card, use the open prop instead.
openboolean—Whether the preview card is currently open.
onOpenChange—Event handler called when the preview card is opened or closed.

HoverCardTrigger

<a>
PropTypeDefaultDescription
classNamestring—
From Base UIPreviewCard.TriggerBase UI docs
handlePreviewCardHandle<unknown>—A handle to associate the trigger with a preview card.
payloadunknown—A payload to pass to the preview card when it is opened.
delaynumber600How long to wait before the preview card opens. Specified in milliseconds.
...props<a> attributes—Every other attribute goes to the <a>, with a ref.

HoverCardContent

<div>
PropTypeDefaultDescription
classNamestring—
arrowbooleanfalseShow an arrow that points at the link. The gap grows from 4px to 8px.
backdropbooleanfalsePut a clear layer under the card (Base UI PreviewCard.Backdrop). Hover on the page stops.
portalProps—Other Base UI props of the inner parts. A className here adds to the component classes.
positionerProps—
backdropPropsPopupPartProps<PreviewCardBackdropProps>—
arrowPropsPopupPartProps<PreviewCardArrowProps>—
From Base UIPreviewCard.PortalBase UI docs
anchor—An element to position the popup against. By default, the popup will be positioned against the trigger.
positionMethod"absolute""fixed"'absolute'Determines which CSS position property to use.
side"bottom""inline-end""inline-start""left""right""top"'bottom'Which side of the anchor element to align the popup against. May automatically change to avoid collisions.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

HoverCardViewport

<div>
PropTypeDefaultDescription
classNamestring—
From Base UIPreviewCard.ViewportBase UI docs
childrenReactNode—The content to render inside the transition container.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use it for an extra look at a link target that has its own page.
  • Keep everything in the card on the target page too: touch has no hover.
  • Render your router link through render on HoverCardTrigger.
  • For a short label of a control, use a Tooltip.
  • For content the user must click to open and act in, use a Popover.
TabFocus on the link opens the card after the delay. Focus never moves into the card.

It is a Base UI Preview Card. Keyboard focus on the link opens it, as a hover does.

The link names its target on its own, and the card holds no only copy of anything.

Open
popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1) · fades in and scales from 95%
Close
popup-exit · 120ms · ease-out (0, 0, 0.2, 1)
  1. AddedHover Card.
Open the release