Skip to Content
⭐️ Leave a star →
ComponentsHoverCard

HoverCard

A richer, interactive alternative to Tooltip — opens on hover/focus after a delay and stays open while you move the pointer into the card. Content is fully interactive (links, buttons). Renders with role="dialog".

Features

Opens on hover after openDelay, closes after closeDelay.
Opens immediately on focus and closes on blur for keyboard users.
Stays open while the pointer moves from the trigger into the card.
Positionable on any side with a configurable offset.
Can be controlled or uncontrolled.
forceMount keeps the card mounted for CSS exit animations.

Example

The latest release was shipped by @grace with help from the platform team. Hover the name to preview their profile.

import { HoverCard } from '@wire-ui/react' <HoverCard.Root> <HoverCard.Trigger>@wire-ui</HoverCard.Trigger> <HoverCard.Content side="bottom"> Headless, AI-native component primitives with zero CSS. </HoverCard.Content> </HoverCard.Root>

Styling

Trigger and Content set data-state ("open" / "closed"); Content also sets data-side. Use these to drive enter/exit transitions and side-specific styling. Content is absolutely positioned relative to the Root (an inline-block wrapper) and given z-index: 50.

<HoverCard.Content className=" opacity-0 transition-opacity data-[state=open]:opacity-100 data-[side=top]:origin-bottom data-[side=bottom]:origin-top "> </HoverCard.Content>

Using data attributes

/* Animate based on open/closed state */ [data-state="open"] { opacity: 1; } [data-state="closed"] { opacity: 0; } /* Side-specific transform origin */ [data-side="top"] { transform-origin: bottom center; } [data-side="bottom"] { transform-origin: top center; }

Root props

PropTypeDefaultDescription
openbooleanControlled open state
defaultOpenbooleanfalseInitial open state (uncontrolled)
onOpenChange(open: boolean) => voidCalled when the open state changes
openDelaynumber300ms to wait before opening on hover
closeDelaynumber200ms to wait before closing after leaving

Trigger props

The Trigger renders a <span> and accepts all standard <span> HTML attributes. It manages onMouseEnter, onMouseLeave, onFocus, and onBlur internally (your handlers are still called).

Content props

PropTypeDefaultDescription
side'top' | 'right' | 'bottom' | 'left''bottom'Side of the trigger to render on
sideOffsetnumber8Gap in px between trigger and card
forceMountbooleanfalseKeep the card mounted while closed (for CSS exit animations)

Content also accepts all standard <div> HTML attributes.

Data attributes

AttributeElementValues
data-stateTrigger, Content"open" / "closed"
data-sideContent"top" / "right" / "bottom" / "left"

Content sets role="dialog".

Accessibility

  • Content renders with role="dialog".
  • Opens immediately on Trigger focus and closes on blur, so keyboard users can reach interactive content inside the card.
  • Pointer users can move from the Trigger into the Content without it closing — the close timer is cancelled while hovering the card.

Keyboard Interactions

KeyDescription
TabMoves focus to the trigger, opening the card immediately.
Shift+TabMoves focus away from the trigger, closing the card.
Last updated on

MIT License © 2026 wire-ui

HoverCard – Wire UI