Velocity X Components

Stats & Numbers

Period Selector Stat Card

A metric card with a Day / Week / Month switch that re-renders its own figure and delta instantly, no reload and no chart library — lets one card do the work three separate stat tiles used to, with a real keyboard-operable tab switcher underneath.

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

Built for astro.

Full docs for Period Selector Stat Card →

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

astro v1.0.1
Period Selector Stat Card
New signups

968

1.8% down

vs previous week

Props

NameTypeRequiredDefaultDescription
labelstringNo'New signups'
periodsStatPeriod[]No[ { id: 'day', tabLabel: 'Day', value: 142, delta: '4.1%', direction: 'up', compareLabel: 'vs previous day' }, { id: 'week', tabLabel: 'Week', value: 968, delta: '1.8%', direction: 'down', compareLabel: 'vs previous week' }, { id: 'month', tabLabel: 'Month', value: 4120, delta: '12.4%', direction: 'up', compareLabel: 'vs previous month' }, ]
defaultPeriodIdstringNo
prefixstringNo''
suffixstringNo''
classNamestringNo''

File this creates

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

text
components/velocity/period-selector-stat-card/PeriodSelectorStatCard.astro

Using the Period Selector Stat Card component

Install it with velocityx add period-selector-stat-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 Stats & Numbers.