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
Align (side=bottom)
Align offset (side=bottom, align=start)
Controlled
Hover or control me
State: closed
Rich Content
Installation
npx shadcn@latest add @byronwade/hover-cardProps
| Prop | Type | Default | Description |
|---|---|---|---|
| side | "top" | "bottom" | "left" | "right" | "inline-start" | "inline-end" | "bottom" | Which side of the trigger the card appears on (HoverCardContent only). |
| sideOffset | number | 4 | Distance 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). |
| alignOffset | number | 4 | Offset in pixels along the alignment axis (HoverCardContent only). |
| className | string | — | Additional CSS class names to apply to the popup element (HoverCardContent only). |