Skip to main content

Installation

Or use the CLI:

Usage

Component API

HoverCard

The root hover card component built on Radix UI. Props:
  • open - Control hover card open state
  • onOpenChange - Callback when open state changes
  • defaultOpen - Initial open state
  • openDelay - 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"
  • align - Alignment (default: "center")
    • Options: "start", "center", "end"
  • 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

    API Reference

    See the Base UI Hover Card documentation for complete API details.