shadcn.io is not affiliated with official shadcn/ui
Hover Card examples · Stats
Growth Stats Hover Card for React
A revenue figure with its growth rate that opens a comparison with the previous period.
A compact chip with $12,543 and a green 12.5% opens the comparison behind the rate: current, previous and the change. Use it in tables and headers where a growth rate needs its numbers on demand.
Preview
Installation
FAQ
What is in the card?
Revenue Growth, vs. previous period, then Current $12,543, Previous $11,156 and Change +$1,387 in text-success.
How is the growth chip made the trigger?
HoverCardTrigger takes the growth chip through render, a button with its classes.
How is the rate shown in the chip?
An up arrow and 12.5% in text-success. For a fall, use a down arrow and text-destructive.
How wide is the card?
The default hover card width. Set a width class such as w-80 on the card to fit longer content.
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 chip 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
- Financial Stats Hover CardA revenue tile that opens a breakdown of
- Simple Stats Hover CardA views tile that opens the views for
- Performance Stats Hover CardAn uptime badge that opens a system
- User Stats Hover CardAn active users tile that opens new
- 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