Velocity X Components

Cards & Expandables

Stat Trend Card

A single-metric KPI tile for a dashboard grid — big number, an auto-coloured up/down delta pill, and an optional inline sparkline so the direction reads at a glance. No chart library, pure inline SVG.

Subscription Included with the Velocity Components subscription.
bash
$ velocityx add stat-trend-card

Built for astro.

Full docs for Stat Trend Card →

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

astro v1.0.1
Stat Trend Card

Weekly active users

12,480

+12.4%

vs last week

Props

NameTypeRequiredDefaultDescription
labelstringYes
valuestring | numberYes
deltanumberNoSigned percentage (or absolute) change. Sign decides the colour + arrow unless `direction` overrides it.
deltaLabelstringNoPre-formatted delta string, used instead of deriving one from `delta` (e.g. "+12.4%").
deltaPeriodstringNo
direction'up' | 'down' | 'flat'No
trendnumber[]No[]
icon'astro' | 'none'No
classNamestringNo''

File this creates

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

text
components/velocity/stat-trend-card/StatTrendCard.astro

Using the Stat Trend Card component

Install it with velocityx add stat-trend-card. 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 Cards & Expandables.