Dialog
A focused surface for decisions that need attention.
Preview a person or link on hover or focus without leaving the page.
npx shadcn@latest add @silicon-ui/hover-cardnpx shadcn@latest add @silicon-ui/hover-cardInstall the dependencies.
npm install @radix-ui/react-popover motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/hover-card/hover-card.tsxcomponents/silicon-ui/hover-card/hover-card.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
HoverCard| Prop | Type | Default |
|---|---|---|
children*The trigger, such as a mention button or a link. It must accept a ref and be focusable. | ReactElement | — |
content*The preview. `HoverCardProfile` covers people; any read only content works. | ReactNode | — |
side | "top" | "bottom" | "left" | "right" | "bottom" |
align | "start" | "center" | "end" | "start" |
openDelayMilliseconds of hover before the first card opens. | number | OPEN_DELAY |
closeDelayMilliseconds of grace after the pointer leaves, so it can travel into the card. | number | CLOSE_DELAY |
className | string | — |
HoverCardProfile| Prop | Type | Default |
|---|---|---|
name* | string | — |
roleRole and team, such as "Product designer, Payments". | string | — |
avatarA portrait URL, or your own image element such as next/image. Initials show when it is missing. | string | ReactNode | — |
bio | string | — |
stats | HoverCardStat[] | [] |
metaA footer line, such as a location and local time. | ReactNode | — |