Hover Card
Preview rich content behind a link when sighted users hover it.
OverlaysRadix Hover Card
Reviewed by @maya two hours ago.
Playground
Tweak the props, the preview and the code follow.
Props
250
150
<HoverCard>
<HoverCardTrigger asChild>
<a href="#">@plumsy</a>
</HoverCardTrigger>
<HoverCardContent>
…
</HoverCardContent>
</HoverCard>Installation
npx @plumsydev/plum-ui add hover-cardUsage
import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card"<HoverCard>
<HoverCardTrigger>@maya</HoverCardTrigger>
<HoverCardContent>Design engineer at Acme.</HoverCardContent>
</HoverCard>Examples
Link preview
Mentions
Inline @mentions with rich previews and an arrow.
API Reference
HoverCard
| Prop | Type | Default |
|---|---|---|
openDelayDelay before opening, in ms. | number | 250 |
closeDelayDelay before closing, in ms. | number | 150 |
HoverCardContent
| Prop | Type | Default |
|---|---|---|
sidePreferred side. | "top" | "right" | "bottom" | "left" | "bottom" |
alignAlignment against the trigger. | "start" | "center" | "end" | "center" |
showArrowAdds an arrow that points at the trigger, with the border wrapped around it. | boolean | false |
Notes
- Hover cards are ignored by keyboard and touch users — only use them for supplementary content.