Skip to content
GetUrUI

Stat cards

4 variantsNew
.md

Four metric cards — headline KPI, scrubbable sparkline, goal ring and two-period comparison — with count-ups, redrawn lines, springing arcs and bars.

statskpimetricdashboardsparklineprogressgoalcomparisonanalytics

KPI

kpi.tsx

Headline figure that counts up with its delta, and a breakdown that springs open into a stacked bar.

$npx shadcn@latest add @geturui/stat-cards-kpi
.zip
PropTypeDefaultDescription
label / periodstring—Metric name and period caption.
value / previousnumber84250 / 74960Current and previous values.
previousLabelstring"Sep"Name of the previous period.
format"currency" | "number""currency"Number formatting.
segments{ label: string; value: number }[]—Breakdown parts.
invertbooleanfalseTreat a drop as good.
classNamestring—Extra classes on the card.

Sparkline

sparkline.tsx

Period tabs redraw the line; pointer or arrow keys scrub to any point and the figure crossfades.

$npx shadcn@latest add @geturui/stat-cards-sparkline
.zip
PropTypeDefaultDescription
labelstring"Active users"Metric name.
unitstring""Suffix after the number.
seriesSparkSeries[]—{ key, caption, points, labels } per tab.
defaultKeystring—Initially selected tab.
classNamestring—Extra classes on the card.

Goal ring

goal.tsx

Progress ring and percentage spring to each logged step; milestones tick and the goal swaps to a done state.

$npx shadcn@latest add @geturui/stat-cards-goal
.zip
PropTypeDefaultDescription
label / unit / deadlinestring—Captions.
defaultValue / goalnumber34 / 48Starting progress and target.
milestonesnumber[][0.25, 0.5, 0.75, 1]Checkpoints as fractions of the goal.
onChange(value: number) => void—Called after each step.
classNamestring—Extra classes on the card.

Comparison

comparison.tsx

Metric tabs swap two period bars that spring to new lengths while the delta crossfades.

$npx shadcn@latest add @geturui/stat-cards-comparison
.zip
PropTypeDefaultDescription
title / currentLabel / previousLabelstring—Captions.
metricsComparisonMetric[]—{ key, label, current, previous, prefix?, suffix?, invert? }.
defaultKeystring—Initially selected metric.
classNamestring—Extra classes on the card.

Install the whole set

Installs every stat cards variant at once. Each section above has its own command for a single variant.

$npx shadcn@latest add @geturui/stat-cards
Download source (.zip)

Accessibility

  • Animated numbers render a static value for screen readers; deltas state Up or Down in words alongside the colour.
  • The sparkline is a slider: arrow keys move through points and the value text is announced.
  • Progress uses role=progressbar with value text, and reduced motion jumps straight to final values.

Related