shadcn.io is not affiliated with official shadcn/ui
Hover Card examples · Stats
User Stats Hover Card for React
An active users tile that opens new, online and peak user counts.
An Active Users tile opens User Activity: active and new users side by side, a Separator, then online now and the peak today. Use it on product and admin dashboards.
Preview
Installation
FAQ
What is in the card?
8,432 Active and 2,156 New Today in a two-column grid, a separator, then Online Now 1,234 and Peak Today 3,421.
How is the stat tile made the trigger?
HoverCardTrigger takes the stat tile through render, a button with its classes.
Why is the users icon blue?
It uses text-info, the informational token, since the number is neither good nor bad. It follows the theme in light and dark mode.
How wide is the card?
w-72 on the card, for the extra content.
The class is on HoverCardContent.
max-w-full keeps it inside narrow screens.
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 tile 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
- Simple Stats Hover CardA views tile that opens the views for
- Profile with Stats Hover CardA username that opens a profile card with
- Financial Stats Hover CardA revenue tile that opens a breakdown of
- Growth Stats Hover CardA revenue figure with its growth rate
- Performance Stats Hover CardAn uptime badge that opens a system
- Info with Icon and Badge Hover CardA Verified badge that opens a card