Prodular UI

Data display

StatPro

A KPI strip: one surface with dividers between metrics, each with a label, a large value, a colored delta, an optional sparkline and a comparison line.

npx prodular-ui add stat

Part of Prodular UI Pro. Preview and read the docs freely, install with a license. See pricing

Revenue

Sparklines under each value. Churn passes invert, so a drop reads as good news.

Monthly recurring revenue
$184,320
Up8.4%
vs $170,040 last 30 days
Net revenue retention
116%
Up3.1 pts
vs 112.9% last quarter
Logo churn
2.1%
Down0.8 pts
26 accounts lost
Paying customers
1,284
Up4.6%
57 new this month

Field operations

Five metrics. On narrow containers the strip wraps to two columns and the odd one spans the last row.

Jobs completed
412
Up6.2%
vs 388 last week
First-time fix rate
87.4%
Up1.9%
Target 85%
Avg. response time
42 min
Down11.3%
vs 47 min last week
Technicians on shift
36
No change0.0%
4 on call tonight
Open work orders
58
Up9.4%
12 past SLA

Anatomy

<Stats>  <Stat>    <StatLabel>Monthly recurring revenue</StatLabel>    <StatContent>      <StatValue>$184,320</StatValue>      <StatDelta value={8.4} />    </StatContent>    <StatComparison>vs last 30 days</StatComparison>    <StatSparkline data={series} />  </Stat></Stats>

Guidance

Use it when

  • The top of a dashboard or report, for three to five numbers people check every day.
  • Pair every delta with a comparison line so the number has a reference: vs last 30 days, vs target.
  • Sparklines when the shape of the trend matters more than the exact history.

Avoid

  • A grid of separate cards, one per metric. Use one Stats strip.
  • More than five metrics in one strip. Split them into two strips with headings.
  • Coloring the value itself. Only the delta carries color.

Rules for AI agents

Published in llms-full.txt and the registry, so coding agents follow them when they build with this component.

  • Render one Stats container with one Stat per metric. Never wrap a Stat in a Card.
  • Pass the raw signed change to StatDelta value. Set invert for metrics where down is good: churn, latency, cost, open tickets, errors.
  • Use format on StatDelta for units that are not percentages, for example points or minutes.
  • Put StatValue and StatDelta inside StatContent so they share a baseline.
  • Give StatSparkline a label when the trend carries meaning, and color it with text-chart-1 to text-chart-5. Do not use raw colors.
  • Use variant="plain" when the strip sits inside an existing Card.

API

Stats

PropTypeDefaultDescription
variant"card" | "plain""card"card draws the surface. plain is for use inside an existing card.

StatDelta

PropTypeDefaultDescription
valuenumberThe signed change. The sign sets the arrow.
invertbooleanfalseDown is good. A negative value turns green.
format(abs: number) => stringFormats the absolute change. Defaults to one decimal with a percent sign.

StatSparkline

PropTypeDefaultDescription
datanumber[]The series, oldest first.
variant"area" | "line" | "bar""area"Shape of the sparkline.
labelstringScreen reader description of the trend.