Installation
Usage
Component API
HoverCard
The root hover card component built on Radix UI. Props:open- Control hover card open stateonOpenChange- Callback when open state changesdefaultOpen- Initial open stateopenDelay- Delay before opening (default:700ms)closeDelay- Delay before closing (default:300ms)
HoverCardTrigger
The element that triggers the hover card. Props:asChild- Compose with child element
HoverCardContent
The hover card content container. Props:side- Placement side (default:"bottom")- Options:
"top","right","bottom","left"
- Options:
align- Alignment (default:"center")- Options:
"start","center","end"
- Options:
sideOffset- Offset from trigger (default:4)alignOffset- Alignment offset
Examples
Basic
A simple hover card with user information:With Custom Delays
Control when the card opens and closes:Different Sides
Control the placement side:Different Alignments
Control the alignment:Controlled
Control the hover card open state:Rich Content
Display rich content in the hover card:Accessibility
- Built on Radix UI for full accessibility
- Can be triggered via keyboard focus
- Screen reader compatible
- ARIA attributes automatically applied
- Focus management