App components / Metrics
Metric
One number that matters. A mono capital label, a big mono figure with quieter decimals, a trend chip and an optional sparkline: a grey line with one orange point. Rising trends are green; falling ones stay grey, never red.
Code
The component itself, ready to drop into your project. Switch between React, Vue and plain HTML; every version uses the same Tailwind classes on Ochre's tokens.
Revenue
£48,213.40
Installation
Examples
Live figures
Changed digits step to their new value; press Refresh.
Revenue
£48,213.40
A row of KPIs
Plain metrics in one card. The falling one stays grey.
Active accounts
5,036
MRR
£186,535.20
Churn
2.4%
Open tickets
38
Sizes and units
S, M and L figures with units and a flat trend.
p95 latency
182ms
Uptime
99.98%
Events today
1,284,902
Plain, Sparkline and Breakdown
The three types with a period footer, rising and falling.
Avg. basket
£42.60
Orders
1,284
Avg. basket
£42.60
- Card£24.7058%
- Apple Pay£12.3529%
- Cash£5.5513%
Motion
Built on Ochre's ease-out curves. With reduced motion switched on, everything still works, it just doesn't move.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | ReactNode | – | Shown in mono capitals. |
| value | string | – | Formatted figure, e.g. "48,213.40". Decimals render quieter. |
| prefix | string | – | Currency or sign before the figure, in muted text. |
| unit | string | – | Unit after the figure at half size: ms, %, GB. |
| trend | { value: string; direction: "up" | "down" | "flat" } | – | Chip under the figure. Up is green; down and flat are grey. |
| caption | ReactNode | – | The baseline after the chip: vs last week. |
| data | number[] | – | Draws a sparkline on the right. |
| highlight | number | – | Index of the orange point. Defaults to the last value. |
| size | "s" | "m" | "l" | "m" | Figure at 20, 28 or 40 pixels. |
| variant | "card" | "plain" | "card" | A flat card, or bare for use inside your own card. |
| breakdown | { label; value: number; display? }[] | – | Breakdown type: a stacked bar and a legend with each part's share. The first part takes the accent. |
| period | ReactNode | – | The footer: the period in mono on a hairline at the foot, like Last 7 days. |
| footer | ReactNode | – | Anything on the right of the footer: a link to the report. |
Usage
Use it for
- The three to five numbers at the top of a dashboard.
- Plain metrics in one card, split by hairlines, for a row of KPIs.
- A sparkline when the shape of the last few weeks matters more than the exact values.
Avoid
- Red for a number that went down: a drop isn't always bad, and grey keeps the page calm.
- Several orange points or coloured lines: one accent, on the value that matters.
- Rounding away the precision people need; quieten the decimals instead.