Hover Card
Use HoverCard to preview supporting information about a link, such as a person's profile.
Preview
Profile preview
Preview a person's name and role beside a profile link.
Loading preview.
Installation
New to this Registry? Complete the base setup before continuing.
npx shadcn@latest add @neumorphism-ui/hover-cardInstall the shared base once, then add components and their dependencies with the CLI.
Usage
Keep HoverCardTrigger a meaningful link and put optional context in HoverCardContent. Readers should still be able to understand and follow the link without opening the preview.
"use client";
import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card";
export default function Example() {
return (
<HoverCard>
<HoverCardTrigger href="/team/alex">Alex Kim</HoverCardTrigger>
<HoverCardContent>Product designer based in Seoul.</HoverCardContent>
</HoverCard>
);
}API Reference
A supplemental preview of a link destination. Do not hide essential content or actions behind hover. The original link must remain meaningful.
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
HoverCard | open / defaultOpen | boolean | — | Set controlled or initial state. |
HoverCardTrigger | delay / closeDelay | number | — | Opening and closing delay in milliseconds. |
HoverCardContent | sideOffset | number | — | Set panel placement or spacing with viewport collision handling. |
Accessibility
- 01
Do not hide essential content or actions behind hover. The original link must remain meaningful.
- 02
Preserve labels and visible focus when customizing render or className.