Xzero UI
Pro library

Stats band

Headline numbers that count up in view, each with a tiny visual that proves it and a context line on hover, plain or in a hairline grid.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/stats-band
Live · keyboard ready

Use this under a hero or between sections to back a claim with numbers. Replace the sample stats in stats-band-data.ts.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/stats-band

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { StatsBand } from "@/components/xzero/blocks/stats-band/stats-band";

export function Numbers() {
  return (
    <StatsBand
      layout="divided"
      stats={[
        {
          value: 2_334_000, notation: "compact", decimals: 1, label: "Deploys in the last 12 months",
          detail: "Across 12,400 teams", context: "Up from 1.4M the year before",
          visual: { kind: "trend", values: [141, 148, 139, 162, 171, 184, 196, 203, 221, 238, 257, 274] },
        },
        { value: 38, suffix: "ms", label: "Median response time", detail: "At the edge, worldwide" },
        { value: 35, label: "Edge regions on six continents", visual: { kind: "map", points: [[-122.4, 37.8], [-0.1, 51.5], [139.7, 35.7]] } },
      ]}
    />
  );
}

API reference

StatsBand

A band of three or four headline numbers, each with an optional tiny visual that proves it. Numbers count up in sequence as the band enters view, then the visuals draw in; hover or focus reveals one line of context.

PropTypeDefaultDescription
statsStat[]statsEach has value and label, plus optional prefix, suffix, decimals, notation ("compact" for 2.3M), detail, context (the hover line), and visual: a trend, uptime strip, latency distribution, or world map. Every visual is optional.
layout"plain" | "divided""plain"plain lets the stats float on whitespace; divided sets them in a hairline grid ruled above and below.
titlestring–Optional heading above the band. Without it the band is labelled "Key numbers".
descriptionstring–Optional line under the heading.
durationnumber1.6Seconds each number takes to count up.
localestring"en-US"Number formatting locale. Fixed by default so server and client agree.
classNamestring–Extra class on the section.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components