Primitives
Primitive

Preview Card

Interactive card that displays content preview on hover or click

A preview card reveals a floating panel of supplementary content when the user hovers or focuses a trigger. Use it for link previews, profile cards, or any rich hover tooltip; for plain text on hover, use Tooltip instead.

Preview

Installation

Usage

Composition

PreviewCardContent composes the portal, positioner, popup, and arrow internally. Set arrow={false} to hide the pointer.

Examples

Simple

A minimal card with text content.

Product Preview

Render rich content like an image and price inside PreviewCardContent.

Text Trigger

Wrap an inline <span> in PreviewCardTrigger to anchor the card to text.

Inline (wrapping text)

When the trigger phrase wraps across lines, the card anchors to the line box under the pointer rather than the full bounding box, and it works with no extra props.

The framework was first announced at a small developer conference and grew out of work on a long-running internal rendering engine that the team had maintained for years before open-sourcing it.

API Reference

The PreviewCard component is built on top of Base UI's PreviewCard. All Base UI props are supported. The documentation below only covers custom props and modified defaults specific to our implementation.

For the complete Base UI API, see the Base UI PreviewCard documentation.

Custom Props

PreviewCardContent

Prop

Modified Defaults

Our implementation changes the following Base UI prop defaults:

  • PreviewCardTrigger: delay defaults to 0 (Base UI defaults to 600)
  • PreviewCardTrigger: closeDelay defaults to 0 (Base UI defaults to 300)
  • PreviewCardContent: align defaults to "center" (Base UI defaults to "start")
  • PreviewCardContent: sideOffset defaults to 8 (Base UI defaults to 0)