Stats & Numbers
Metric Comparison Grid
A grid of metric cards for a monthly or quarterly review, each one showing two periods side by side with its own delta. A per-metric goodDirection flag lets churn or latency colour correctly when down is the win, instead of every metric reading green-for-up.
$ velocityx add metric-comparison-grid Built for astro.
Full docs for Metric Comparison Grid →
Needs a licence key —
subscribe here, then
velocityx loginonce.
Revenue
12.4% increasedThis month
$48.2k
Last month
$42.9k
New customers
13.8% increasedThis month
214
Last month
188
Churn
0.5pp decreasedThis month
1.8%
Last month
2.3%
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| metrics | ComparisonMetric[] | Yes | ||
| periodALabel | string | No | 'This period' | |
| periodBLabel | string | No | 'Last period' | |
| columns | 2 | 3 | 4 | No | 3 | |
| className | string | No | '' |
File this creates
The CLI writes this path into your project, relative to its root — nothing else moves.
components/velocity/metric-comparison-grid/MetricComparisonGrid.astro Using the Metric Comparison Grid component
Install it with velocityx add metric-comparison-grid.
The CLI writes the source straight into your project — no runtime dependency, no registry
lock-in, and it themes itself from the same primary-*/accent-* scale as the rest of the library.
Related components
More from Stats & Numbers.
Stat band whose numbers count up when the section scrolls into view, then settle. No runtime dependency — plain Astro plus a small inline observer. Honours prefers-reduced-motion by rendering final values immediately.
astroPuts two numbers on one shared scale and calls out the delta — the proof-point shape for 'we cut your load time' or 'conversion rate before vs. after' case studies. Ships a screen-reader summary alongside the bars, so the comparison reads correctly even without the visual.
astroOne headline figure sized to carry a section on its own, with a short annotation line underneath for context. Locale-safe number formatting (including compact '4.2M' notation) and a count-up that lands on the real value immediately for reduced-motion users.
astroThe compact way to show actual-vs-target on a scorecard row: a thin fill against a qualitative poor/satisfactory/good band, with a tick marking the target, so a whole KPI reads in the space a single number used to take. Values stay in text too, so it holds up for anyone who can't read the bar visually.
astro