Velocity X Components

Stats & Numbers

Sparkline Stat

A value paired with a compact inline trend line — the pattern for a metric row where every figure needs its recent history at a glance. Hand-rolled SVG computed from a plain number array, no chart library, with an accessible text summary so the trend is never color-only.

Subscription Included with the Velocity Components subscription.
bash
$ velocityx add inline-sparkline-stat

Built for astro.

Full docs for Sparkline Stat →

Needs a licence key — subscribe here, then velocityx loginonce.

astro v1.0.1
Sparkline Stat
Signups
2,940 +18%
Signups: 2,940, trending up over last 7 days

Props

NameTypeRequiredDefaultDescription
labelstringNo'Weekly signups'
valuestringNo'1,284'Pre-formatted current value, e.g. "$48.2k".
pointsnumber[]No[42, 48, 45, 61, 58, 70, 76]The series the sparkline draws, oldest first.
deltastringNo
deltaDirection'up' | 'down' | 'flat'NoComputed from the first/last point when omitted.
periodLabelstringNo'the last 7 periods'Used only in the accessible summary, e.g. "last 7 days".
classNamestringNo''

File this creates

The CLI writes this path into your project, relative to its root — nothing else moves.

text
components/velocity/inline-sparkline-stat/InlineSparklineStat.astro

Using the Sparkline Stat component

Install it with velocityx add inline-sparkline-stat. 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.

More from Stats & Numbers.