npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-hover-card.json --yesHover card
ProA small card previewing a person or a record while the pointer rests on its name, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- HoverCardTriggerWhat the card previews
- HoverCardContentThe card
- HoverCardPersonA person in the card
import { HoverCard, HoverCardTrigger, HoverCardContent, HoverCardPerson } from '@/components/ui/goop/hover-card';
import { Link } from '@/components/ui/goop/link';
import { Avatar } from '@/components/ui/goop/avatar';
function MemberName() {
return (
<HoverCard>
<HoverCardTrigger asChild>
<Link variant="plain" href="/members/ngozi-ilori">
Ngozi Ilori
</Link>
</HoverCardTrigger>
<HoverCardContent>
<HoverCardPerson
name="Ngozi Ilori"
description="Design lead"
meta="Lagos · 14:20 local"
avatar={
<Avatar variant="solid" size="lg" name="Ngozi Ilori">
NI
</Avatar>
}
/>
</HoverCardContent>
</HoverCard>
);
}When to use
- A small card previewing a person or a record while the pointer rests on its name.
When not to use
- For one line about a button use Tooltip.
Installation
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Hover card on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-hover-card.json --yesAdd the Goop Hover card to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { HoverCard, HoverCardTrigger, HoverCardContent, HoverCardPerson } from '@/components/ui/goop/hover-card';
import { Link } from '@/components/ui/goop/link';
import { Avatar } from '@/components/ui/goop/avatar';
function MemberName() {
return (
<HoverCard>
<HoverCardTrigger asChild>
<Link variant="plain" href="/members/ngozi-ilori">
Ngozi Ilori
</Link>
</HoverCardTrigger>
<HoverCardContent>
<HoverCardPerson
name="Ngozi Ilori"
description="Design lead"
meta="Lagos · 14:20 local"
avatar={
<Avatar variant="solid" size="lg" name="Ngozi Ilori">
NI
</Avatar>
}
/>
</HoverCardContent>
</HoverCard>
);
}- Fits: record (its recipe).
- Also known as: PreviewCard, ProfileCard, UserCard, LinkPreview, Hovercard.
- Wrap a person's or a record's link in a HoverCard to preview it on hover or focus, with HoverCardPerson for a person; keep every fact on the linked page too, and no control in the card.
- width, padding, gap, text, motion: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| Defaults | defaultOpen = false; openDelay = 600; closeDelay = 200 |
| Part | What it is |
|---|---|
| HoverCardTrigger | What the card previews; takes asChild |
| HoverCardContent | The card; container?: HTMLElement | null — Where the card is portalled; the end of <body> when left out |
| HoverCardPerson | A person in the card; name: ReactNode — The person's name; description?: ReactNode — A line under the name: their role or their email; avatar?: ReactNode — Their picture or initials: the theme's Avatar, size="lg"; meta?: ReactNode — A line under the description: their team, their local time; children?: ReactNode — Anything else, 8 px under the person's lines |
- data-slot values (to select a part by): hover-card-content, hover-card-person, hover-card-person-caption, hover-card-person-content, hover-card-person-description, hover-card-person-media, hover-card-person-title, hover-card-trigger
Keyboard
| Key | What it does |
|---|---|
| Tab | Onto the trigger (the caller's link): the card opens after the delay; off it, the card closes |
| Escape | Close the card at once; it stays closed while the pointer rests on the trigger |
| Enter | Follow the link, as the link always does |
Accessibility
- The behaviour layer under the part answers keys, focus and dismissal: never write your own.
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| expanded | the attribute data-state=closed |
| open | the attribute data-state=closed |
Motion
- The part sets its own motion: add no transition or animation of your own.
- How the theme moves, and how to move your own parts the same way: Motion.
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.