Hover Card
For sighted users to preview content available behind a link.
When to use
A HoverCard shows a preview of richer content (a user card, link preview, etc.) when a sighted user hovers a link or trigger.
- Prefer
Tooltipfor short, non-interactive labels on controls. - Prefer
Popoverwhen the content must be reachable by all users and may contain interactive elements.
Arrow
Render HoverCard.Arrow as a child of HoverCard.Content when the card previews one specific link and needs a tip pointing at it. Radix positions the arrow with floating-ui's arrow middleware, so it stays centered on the trigger when collision detection shifts or flips the content. The arrow's fill and border repaint HoverCard.Content's own edge across its base, so the two edges read as one line. The tip also casts its own shadow, because shadow-md on HoverCard.Content stops at that content's border and an unshadowed tip reads as pasted on. That shadow is clipped at the base, so it never darkens the content's interior.
HoverCard.Arrow takes no asChild. The shape is two layers (a filled polygon, plus a polyline that strokes the slanted edges only), and a swapped element loses the border. Restyle it with className instead: fill-* for the surface and a stroke-* on the arrow's polyline child for the edge, since Radix renders the arrow as an svg where bg-* paints nothing.
Layering and z-index
HoverCard.Content renders at Tailwind z-50, Mantle's float tier. When composed inside an open Dialog, AlertDialog, or Sheet, it portals into that overlay's positioner and paints above the overlay that owns it. Outside every overlay, it portals to document.body, below the overlay tier (z-60). When sibling floats share a container, the most recently mounted float paints on top.
HoverCard does not render a backdrop. Modal layers such as Dialog, Sheet, and AlertDialog do render backdrops, so stacking those layers compounds the dim and blur effect on the layers underneath.
Composition
Compose the parts of a HoverCard together to build your own:
API Reference
The HoverCard component is built on top of Radix UI Hover Card.
HoverCard.Root
The root stateful component that manages the open/closed state of the hover card.
HoverCard.Content renders at Tailwind z-50, Mantle's float tier. When composed inside an open Dialog, AlertDialog, or Sheet, it portals into that overlay's positioner and paints above the overlay that owns it. Outside every overlay, it portals to document.body, below the overlay tier (z-60). When sibling floats share a container, the most recently mounted float paints on top.
HoverCard.Trigger
The trigger element that opens the hover card when hovered.
HoverCard.Content
The content to render inside the hover card. Appears in a portal with rich styling and animations.
HoverCard.Content renders at Tailwind z-50, Mantle's float tier. When composed inside an open Dialog, AlertDialog, or Sheet, it portals into that overlay's positioner and paints above the overlay that owns it. Outside every overlay, it portals to document.body, below the overlay tier (z-60). When sibling floats share a container, the most recently mounted float paints on top.
HoverCard.Content sets position: relative, so HoverCard.Arrow's absolutely-positioned wrapper keeps one containing block through the open animation. An absolutely-positioned child of the content therefore anchors to the content.
HoverCard.Arrow
An optional tip that points from HoverCard.Content at its trigger. Render it as a child of HoverCard.Content. Radix renders it as an svg, so fill-* paints the surface and bg-* paints nothing.
It takes no asChild — the shape is a filled polygon plus a polyline that strokes the slanted edges, and a swapped element loses the border that continues HoverCard.Content's edge.
HoverCard.Portal
The portal container that renders hover card content outside the normal DOM tree. HoverCard.Content already renders inside this portal internally, so you rarely need this part directly — reach for it only to customize portal placement with container, or to wrap multiple HoverCard.Content instances in one shared portal.