shadcn.io is an independent project built on shadcn/ui
The tile shows an up-trend icon, 12,543, and Total Views. The card is titled View Statistics and lists Today 342, This Week 2,156, and This Month 8,932.
Reach for it when a total needs three periods and nothing more. On a touch screen, open the breakdown in a Popover. In React, Base UI does not add up the views.
Installation
Anatomy

Usage
<HoverCard>
<HoverCardTrigger
closeDelay={100}
delay={10}
render={
<button
className="flex items-center gap-2 rounded-lg border bg-card p-4 text-start hover:bg-accent"
type="button"
/>
}
>
<TrendingUpIcon aria-hidden="true" className="size-5 text-success" />
<div>
<div className="font-bold text-2xl">12,543</div>
<div className="text-muted-foreground text-sm">Total Views</div>
</div>
</HoverCardTrigger>
<HoverCardContent className="max-w-full">
<div className="flex flex-col gap-2">
<h4 className="font-semibold text-sm">View Statistics</h4>
<div className="flex flex-col gap-1 text-muted-foreground text-sm">
<div className="flex justify-between">
<span>Today:</span>
<span className="font-medium text-foreground">342</span>
</div>
<div className="flex justify-between">
<span>This Week:</span>
<span className="font-medium text-foreground">2,156</span>
</div>
<div className="flex justify-between">
<span>This Month:</span>
{/* The rest of the file is under Installation. */}FAQ
What is in the card?
View Statistics and three rows: Today 342, This Week 2,156 and This Month 8,932, with the numbers in the foreground color.
How is the stat tile made the trigger?
HoverCardTrigger takes the stat tile through render, a button with its classes.
How is the tile styled?
A bordered bg-card button with a trending-up icon in text-success, the number in large bold text and the label in muted text. text-start keeps the text aligned in both directions.
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 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.
API Reference
Hover Card
No extra props in this demo. The rest is on the Hover Card page.




