Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Data display

Stat

Free14.3 KB gzipped

A big, bold number with a label, for dashboards and box scores: points, revenue, completion rates. Optional trend, progress, icon, and sparkline.

Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · No keyboard interaction of its own · Full report

Import

tsx
import { Stat, StatGroup } from "@vjdesigns/vjdesigns-ui";

Importing only Stat adds about 14.3 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.

Examples

Basic

change shows a trend with an arrow and a sign, so it never relies on color alone.

Monthly revenue
$48,200, increased by 12.4% vs last month
tsx
import { Stat } from "@vjdesigns/vjdesigns-ui";

export function Basic() {
  return (
    <Stat
      label="Monthly revenue"
      value={48200}
      format={{ style: "currency", currency: "USD", maximumFractionDigits: 0 }}
      change={0.124}
      comparisonLabel="vs last month"
      size="lg"
    />
  );
}

Group

StatGroup lays out related stats as a description list.

Active users
2,481, increased by 8%
Churn
2.1%, increased by 0.4%
Avg. session
6.4min, decreased by 3%
tsx
import { Stat, StatGroup, UsersIcon } from "@vjdesigns/vjdesigns-ui";

export function Group() {
  return (
    <div style={{ width: "100%" }}>
      <StatGroup columns={{ base: 1, md: 3 }} variant="card" divided>
        <Stat label="Active users" value={2481} change={0.08} icon={<UsersIcon />} />
        <Stat label="Churn" value={0.021} format={{ style: "percent", maximumFractionDigits: 1 }} change={0.004} positiveIsGood={false} />
        <Stat label="Avg. session" value={6.4} unit="min" change={-0.03} />
      </StatGroup>
    </div>
  );
}

With progress

progress adds a bar toward a goal; variant="accent" adds a colored edge.

Fundraising
$36,500
Goal: $50,00073%
tsx
import { Stat } from "@vjdesigns/vjdesigns-ui";

export function WithProgress() {
  return (
    <div style={{ width: "100%", maxWidth: "20rem" }}>
      <Stat
        variant="accent"
        label="Fundraising"
        value={36500}
        format={{ style: "currency", currency: "USD", maximumFractionDigits: 0 }}
        progress={{ value: 36500, max: 50000, label: "Goal: $50,000", showValue: true }}
      />
    </div>
  );
}

Accessibility

The change isn't just an arrow and a color: screen readers hear a generated sentence with the direction, the amount and the comparison. positiveIsGood={false} makes a rise in tickets read as bad news, and animate counts up visually while screen readers always get the final value (and reduced-motion users skip the animation).

Revenue
$48,200, increased by 12.4% vs last month
Support tickets
312, increased by 8% vs last month
tsx
import { Stat, StatGroup } from "@vjdesigns/vjdesigns-ui";

export function Accessibility() {
  return (
    <StatGroup columns={{ base: 1, sm: 2 }} variant="card">
      <Stat
        label="Revenue"
        value={48200}
        format={{ style: "currency", currency: "USD", maximumFractionDigits: 0 }}
        change={0.124}
        comparisonLabel="vs last month"
        animate
      />
      <Stat label="Support tickets" value={312} change={0.08} positiveIsGood={false} comparisonLabel="vs last month" />
    </StatGroup>
  );
}

Translated

Currency, percentages and the generated change sentence follow the locale: German shows 48.200 € and 3,4 %.

Umsatz
48.200 €, um 12,4 % gestiegen ggü. Vormonat
Konversionsrate
3,4 %, um 2 % gesunken
tsx
import { Stat, StatGroup, LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import de from "@vjdesigns/vjdesigns-ui/locales/de";

export function Translated() {
  return (
    <LocaleProvider locale="de" messages={de}>
      <StatGroup columns={{ base: 1, sm: 2 }} variant="card">
        <Stat
          label="Umsatz"
          value={48200}
          format={{ style: "currency", currency: "EUR", maximumFractionDigits: 0 }}
          change={0.124}
          comparisonLabel="ggü. Vormonat"
        />
        <Stat label="Konversionsrate" value={0.034} format={{ style: "percent", maximumFractionDigits: 1 }} change={-0.02} />
      </StatGroup>
    </LocaleProvider>
  );
}

Right to left

The first example again, inside a right-to-left LocaleProvider (Arabic). Layout, spacing and arrow icons mirror, and the components' built-in text is translated. The example's own text stays in English.

Basic

Monthly revenue
‏48,200 US$, زاد بمقدار 12.4‎%‎ vs last month
tsx
import { LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ar from "@vjdesigns/vjdesigns-ui/locales/ar";

// Basic is the "Basic" example above.
<LocaleProvider locale="ar" messages={ar}>
  <Basic />
</LocaleProvider>

Usage notes

Semantics: a description list. Standalone, the root is a <dl>; inside a StatGroup (itself a <dl>), the root is a <div> grouping one <dt> (the label) with its <dd>s (value and change, help text, progress, sparkline). Screen readers read it as "Points: 24.3, increased by 4.2% from last week". Trends are never color- or arrow-only: the sign is in the visible text and the direction is spelled out in hidden text.

API reference

Stat

Stat props
PropTypeDefault
labelRequired

Eyebrow label above the value, shown in uppercase display type (e.g. "Points"). Rendered as the <dt>.

ReactNode—
valueRequired

The headline value. Numbers are formatted with format and locale, and can count up with animate. Any other node is rendered as is.

ReactNode—
format

Intl.NumberFormat options for a numeric value, e.g. { notation: "compact" } (12.4K), { style: "percent" } (pass a fraction, 0.48 shows 48%), or { style: "currency", currency: "USD" }.

Intl.NumberFormatOptions—
locale

Locale(s) for number formatting.

string | string[]the user's locale
prefix

Text before the value, at a smaller size (e.g. "#" or "

quot; when not using currency format).

ReactNode—
suffix

Text right after the value, at a smaller size (e.g. "%" or "+").

ReactNode—
unit

Unit after the value in small caps type, e.g. "PPG" or "MIN".

ReactNode—
helpText

Muted supporting text under the value, e.g. "vs. last 5 games".

ReactNode—
icon

Decorative icon next to the label, in a soft tone-tinted circle. Hidden from assistive technology.

ReactNode—
size

Type and spacing scale. xl is for hero, scoreboard numbers.

"sm""md""lg""xl""md"
align

Horizontal alignment.

"start""center""end""start"
variant

Surface style.

"plain""card""accent""plain"
accentPosition

Edge the accent bar sits on.

"start""top""start"
tone

Tints the icon circle, the accent bar, and the progress fill.

"neutral""primary""accent""success""warning""danger""info""primary" for the icon and progress; the accent bar defaults to `"accent"`
change

Change since the comparison period, formatted with changeFormat. With the default percent format, pass a fraction: 0.042 shows +4.2%.

number—
changeType

Direction of the change.

"increase""decrease""neutral"inferred from the sign of `change`
positiveIsGood

Whether an increase is good news. Set false for stats like turnovers or fouls, so an increase shows in the danger tone and a decrease in success.

booleantrue
changeFormat

Intl.NumberFormat options for change.

Intl.NumberFormatOptions{ style: "percent", maximumFractionDigits: 1 }
comparisonLabel

The comparison period, appended to the screen-reader change text, e.g. "from last week" reads as "increased by 4.2% from last week".

string—
changeLabel

Replaces the whole generated screen-reader change text.

string—
progress

Thin progress bar under the value, e.g. toward a season goal.

StatProgress—
sparkline

Slot for a small chart (e.g. a sparkline), shown beside the value. Give it its own text alternative.

ReactNode—
animate

Counts a numeric value up from 0 when the stat scrolls into view (and from the old value when it changes). Skipped under prefers-reduced-motion. Screen readers always get the final value.

booleanfalse
loading

Shows placeholder blocks instead of the value and change, and sets aria-busy.

booleanfalse
loadingLabel

Screen-reader text while loading.

string"Loading"

Also accepts native <div> attributes, plus className, style and ref.

StatGroup

A responsive row or grid of Stats, such as a player's box-score line. Renders one <dl>, so the whole group is a single description list.

With divided, stats sit edge to edge with hairline dividers; give the stats variant="plain" there (a card stat's shadow would be clipped).

StatGroup props
PropTypeDefault
children

Stat elements. Each renders as a <div> group of <dt> and <dd>s inside this <dl>.

ReactNode—
columns

Number of columns, fixed or per breakpoint (mobile first), e.g. { base: 2, md: 5 }. When not set, stats fill the row and wrap automatically.

Responsive<number>—
divided

Draws hairline dividers between stats, across wrapped rows too.

booleanfalse
variant

Surface style.

"plain""card""plain"

Also accepts native <dl> attributes, plus className, style and ref.

See what changed in each version in the Changelog.

Accessibility report

Stat targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.

axe-core audit (live)

Running accessibility audit

Checking the examples above…

Lighthouse audit

Light mode

Score 100

38 passed · 0 failed · 27 not applicable · 10 to check by hand

Dark mode

Score 100

38 passed · 0 failed · 27 not applicable · 10 to check by hand

Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.

Built-in behavior

Keyboard

Not focusable, so there's no keyboard interaction of its own.

Roles and states

Roles and states
ElementRoleStates and properties
Label and valueterm and definition<dl> / <dt> / <dd>
Change indicatornoneArrow aria-hidden; direction spoken as text
progressprogressbararia-valuenow, aria-valuemin, aria-valuemax

Manual checks

Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.

Manual accessibility checks
CheckWhat to testWCAG 2.2
KeyboardEvery action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck.2.1.1 (A), 2.1.2 (A)
FocusFocus moves in a logical order, is always visible, and isn't hidden behind sticky headers.2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA)
Screen readersNames, roles and states are announced correctly, and status changes are announced without moving focus.1.3.1 (A), 4.1.2 (A), 4.1.3 (AA)
ColorMeaning never depends on color alone; your own colors meet contrast in both modes.1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA)
Zoom and reflowAt 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed.1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA)
Pointer targetsClick and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap.2.5.8 (AA), 2.5.5 (AAA)
MotionAnimations respect the reduced-motion setting.2.3.3 (AAA)