Skip to content
IndexRequest a UIAboutContact

Stat Card with Trend Delta

KPI cards with value, change since last period and a sparkline, where a falling number can be good news.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean dashboard of three KPI cards in a row, Revenue 48.2k with a green up arrow plus 12 percent and an upward sparkline, Users 8,431 with a grey flat arrow 0 percent, and Churn 2.1 percent with a green down arrow minus 0.4 points labelled improved with a falling sparkline, light theme, rounded cards, thin dividers, small labels above values, flat modern style. Negative: gradients, 3D, clutter, text errors. Reduced motion: static design.

About this pattern

Definition

A stat card shows one number with its change over time. The arrow shows direction, but colour and wording must show whether the change is good or bad: a rising churn rate is bad and a falling one is good. Mixing the two up is a common dashboard mistake.

Purpose & UX principles

  • Show the value large, then the delta with an arrow, a sign and the period.
  • Colour by meaning (good, bad, neutral), not by direction.
  • Add a small sparkline to show the shape of the trend.
  • Include text like improved or worse in the accessible name so colour is not the only cue.

Interaction states

  • Switch the period between 7 days and 30 days.

Motion specification

  • Values change instantly.
  • Reduced motion: nothing animates.

Responsive behaviour

  • Use consistent number formatting and units.
  • Keep sparklines unlabelled but supply the overall change in text.

Code

HTML
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Period"><button data-p="0" aria-pressed="true">7 days</button><button data-p="1" aria-pressed="false">30 days</button></div><div class="gd" id="gd"></div></div>

Related patterns

Sparkline Trend Rows

↗
Sparkline Trend RowsData Visualization

Number Count Up

↗
Number Count UpData Visualization

Radial Gauge Meter

↗
Radial Gauge MeterData Visualization