Skip to content
shadcn.io

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.

Framework
UI library

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

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

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.