Components

Hover Card

Reveals a floating preview of related content when the user hovers over a link or trigger — ideal for profile cards, footnotes, and inline detail.

Basic usage

Wrap a trigger in HoverCardTrigger and put the floating content in HoverCardContent. Hover the link below to preview.

Positioning

Control placement with side and align on the content, and tune timing with openDelay on the root.

Rich content

The content slot is unstyled inside — compose avatars, metadata, and actions freely, and widen it with className.

Props

PropTypeDefaultDescription
openDelaynumber700Milliseconds to wait after pointer enter before the card opens. Set on the root HoverCard.
closeDelaynumber300Milliseconds to wait after pointer leave before the card closes. Set on the root HoverCard.
defaultOpenbooleanfalseOpen state when initially rendered, for uncontrolled usage.
openbooleanControlled open state of the card.
onOpenChange(open: boolean) => voidCalled when the open state changes.
asChildbooleanfalseOn HoverCardTrigger, merges props onto the child element instead of rendering an anchor.
side'top' | 'right' | 'bottom' | 'left''bottom'Preferred side of the trigger to render the content against.
align'start' | 'center' | 'end''center'Alignment of the content relative to the trigger.
sideOffsetnumber4Distance in pixels between the content and the trigger.
classNamestringAdditional Tailwind classes merged onto HoverCardContent.

Accessibility

  • Hover cards are pointer-driven and supplementary — never put essential content or actions inside, since touch and keyboard-only users may not trigger them.
  • The card also opens on keyboard focus of the trigger and closes on blur or Escape, so keyboard users still receive the preview.
  • Use asChild to render a real focusable element (a link or Button) as the trigger so it stays in the tab order.
  • Open and close timing honour openDelay and closeDelay, preventing the card from flickering as the pointer passes over the trigger.