Skip to content

Hover Card

For sighted users to preview content available behind a link.

Install

Bash
npx @madeui/cli add hover-card

Usage

TSX
import {
  HoverCard,
  HoverCardContent,
  HoverCardTrigger,
} from '@/components/ui/hover-card';

Composition

TSX
<HoverCard>
  <HoverCardTrigger />
  <HoverCardContent />
</HoverCard>

Sides

API reference

Built on Base UI Preview Card. The table below covers the props this library adds or changes — every other prop is forwarded to the underlying Base UI part; see the Base UI Preview Card API reference.

HoverCardContent

PropTypeDefaultDescription
side'top' | 'right' | 'bottom' | 'left''bottom'
sideOffsetnumber4Distance from the trigger, in px.
align'start' | 'center' | 'end''center'
alignOffsetnumber4
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.

Was this page helpful?