Hover Card

A compound component that displays a floating preview card when hovering over a trigger element, built on Base UI's PreviewCard primitive.

Default
Alignment
Controlled
Hover or control me
State: closed
Placement

Installation

npx shadcn@latest add @byronwade/hover-card

Props

PropTypeDefaultDescription
side"top" | "bottom" | "left" | "right" | "inline-start" | "inline-end""bottom"Which side of the trigger the card appears on (HoverCardContent only).
sideOffsetnumber4Distance in pixels between the trigger and the card (HoverCardContent only).
align"start" | "center" | "end""center"Alignment of the card relative to the trigger (HoverCardContent only).
alignOffsetnumber4Offset in pixels along the alignment axis (HoverCardContent only).
classNamestringAdditional CSS class names to apply to the popup element (HoverCardContent only).