Stat Card

NEW

A KPI tile with a count-up headline number, a direction-aware delta pill, and a scrubable sparkline. Pair several with StatGrid for a responsive metrics row that works from phones to wide dashboards.

Revenue

8.2%

$0

Last 14 days

Active users

20%

0

Last 14 days

Conversion

6.7%

0.00%

Last 14 days

Churn

26%

0.00%

Last 14 days

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/stat-card

API Reference

PropTypeDefaultDescription
labelstring—Metric name shown above the headline number
valuenumber—Headline number; usually the latest point of trend
trendnumber[]—Sparkline points ordered oldest to newest
trendLabelsstring[]—Names for each trend point, shown while scrubbing
previousnumber—Previous-period value used to compute the delta pill
deltanumber—Explicit delta percentage, overriding the computed value
goodWhen"up" | "down""up"Which direction counts as positive news
periodstring"vs previous period"Caption under the number when not scrubbing
format(n: number) => stringIntl.NumberFormatFormats the headline, labels, and aria text
colorstringCHART_COLORS[0]Sparkline stroke and gradient color
animatedbooleantrueCounts up on mount and animates the line (disabled for reduced motion)
classNamestring""Additional CSS classes for the card
StatGrid.childrenReactNode—StatCard tiles to arrange responsively
StatGrid.classNamestring""Additional CSS classes for the grid