Hover Card

A preview that appears while the pointer rests on a link, on the popover's glass.

Installation

pnpm dlx shadcn@latest add @cupertinoui/hover-card

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card"

<HoverCard>
  <HoverCardTrigger href="/john">@john</HoverCardTrigger>
  <HoverCardContent>…</HoverCardContent>
</HoverCard>

API Reference

Every part forwards the props of the underlying Base UI Preview Card part. The props below are the ones CupertinoUI adds or changes.

HoverCardContent

PropTypeDescription
side / align / sideOffsetWhere it opens.
classNamestringExtra classes, merged with the component's own.