A popover card that appears on hover to preview additional content without navigating away.
import {HoverCard} from "@heroui-pro/react";
<HoverCard>
<HoverCard.Trigger>{/* ... */}</HoverCard.Trigger>
<HoverCard.Content aria-label="Profile preview">
<HoverCard.Arrow /> {/* Optional */}
{/* ... */}
</HoverCard.Content>
</HoverCard>;HeroUI follows the BEM methodology to ensure component variants and states are reusable and easy to customize.
The Hover Card component uses these CSS classes:
.hover-card__trigger: Inline wrapper around the trigger element.hover-card__content: The floating panel that appears on hover.hover-card__arrow: Optional pointing arrow connecting content to trigger[data-entering="true"] / [data-exiting="true"] on .hover-card__content (fade + zoom + slide animation). Skipped when swapping between cards during the shared warm-up window.[data-placement="top|bottom|left|right"] on .hover-card__content and .hover-card__arrow (directional animations and arrow rotation)The root component. Wraps RAC PreviewTrigger to manage hover state and open/close timing. Hovering the trigger opens the card after openDelay, and a safe area between the trigger and the card keeps it open while the pointer travels toward it, even diagonally. Delays are coordinated globally with other hover cards and tooltips: once one has opened, the next one opens immediately instead of waiting out its openDelay again.
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | - | Controlled open state |
defaultOpen | boolean | - | Default open state (uncontrolled) |
onOpenChange | (open: boolean) => void | - | Callback when open state changes |
openDelay | number | 700 | Time in ms before opening after hover |
closeDelay | number | 300 | Time in ms before closing after pointer/focus leave |
isDisabled | boolean | false | Prevents the hover card from opening |
children | ReactNode | - | Trigger and Content elements |
Inline wrapper that tracks hover, focus, and long press on its children. On touch, a long press opens the card and moves the screen reader cursor into it.
Also supports all native span HTML attributes.
The floating panel. Wraps RAC Popover and renders with role="dialog".
| Prop | Type | Default | Description |
|---|---|---|---|
placement | Placement | 'top' | Popover placement relative to the trigger |
offset | number | 8 | Distance from the trigger |
Also supports all RAC Popover props except the open state ones (isOpen, defaultOpen, onOpenChange) and triggerRef, which are owned by the root.
Optional pointing arrow. Wraps RAC OverlayArrow. Renders a default SVG arrow when no children are provided.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | - | Custom arrow element |
Also supports all RAC OverlayArrow props.
| Key | Action |
|---|---|
Tab (onto the trigger) | Opens the card when the trigger receives focus |
Tab (from the trigger) | Moves focus into the card |
Escape | Closes the card |
aria-label to HoverCard.Content to give the dialog an accessible name.Resources