Account

Cards

Creative

Stat Card

The number counts up, the sparkline draws left to right, and change is marked by arrow and sign, not colour alone.

Install

Included with Creative: needs your API key. Initialize and log in once.

Terminal
npx @galactrex/ui add stat-card

Usage

Example
import { StatCard } from "@/components/galactrex/stat-card";

<StatCard label="Downloads" value={48210} change={12.4} trend={[3, 5, 4, 8, 9]} />

Source

Installs to components/galactrex/stat-card.tsx, with the shared motion primitives beside it.

Source for this component comes with its plan. Install it with the command above, or open your licensed copy here.

See plans

Props

PropTypeDefaultDescription
labelstring—Metric.
valuenumber—Value.
format / localeIntl options—Formatting.
changenumber—Percent change.
trendnumber[]—Sparkline values.
periodstring—Comparison period.
classNamestring—Extra classes for the outer element.

Variants

  • Revenue. Currency format.

Accessibility

  • Counter reads the final value; change has text, not only colour.

Motion and reduced motion

  • Count-up and a path draw on arrival.
  • Reduced motion: final state.