shadcn.io is not affiliated with official shadcn/ui
Hover Card examples · Profile
Simple Profile Hover Card for React
A username that opens a small card with the person's avatar, name and role.
The simplest profile card: a username that opens the person's avatar, name and role. Use it for mentions and bylines, and start from it when you need a richer profile.
Preview
Installation
FAQ
What is in the card?
An Avatar beside Hayden Bleasel and Product designer and developer.
How is the username link made the trigger?
HoverCardTrigger renders an anchor itself, so the username link is the trigger with href and its classes set on it.
What if the picture fails to load?
AvatarFallback shows the initials HB instead. The image has the username as its alt.
Where does the profile come from?
It is written in the demo. In an app, load it when the card opens, and show a Skeleton while it loads.
How do I change how fast the card opens and closes?
The card opens a moment after the pointer rests on the trigger and stays up long enough for the pointer to move into it. Both delays are in milliseconds.
The demo sets delay 10 and closeDelay 100 on HoverCardTrigger. side and align on HoverCardContent place it.
Does the card open from the keyboard and on touch screens?
Focusing the username opens the card, moving focus away or pressing Escape closes it. Touch screens have no hover, so keep what matters reachable elsewhere, or use a Popover when the card has to open on a tap.
Related
- Profile with Badge Hover CardA name with a small avatar that opens a
- Profile with Follow Button Hover CardA username that opens a profile card with
- Profile with Stats Hover CardA username that opens a profile card with
- Profile with Location Hover CardA username that opens a profile card with
- Info with Icon and Badge Hover CardA Verified badge that opens a card
- Info with Title Hover CardAn info icon beside a label that opens a