Stats band
A band of big numbers with labels.
Preview
Each number counts up once when the band scrolls into view. The final number is in the page before JavaScript and for screen readers. With reduced motion turned on, it renders the plain layout.
By the numbers
Sample data.
- Sample installs
- 12,000+
- Sample uptime
- 99.9%
- Sample countries
- 48
- Sample rating
- 4.8
By the numbers
Sample data.
- Sample installs
- 12,000+
- Sample uptime
- 99.9%
- Sample countries
- 48
- Sample rating
- 4.8
Installation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { StatsBand } from "@/components/custom/stats-band";
<StatsBand
title="By the numbers"
stats={[
{ value: 12000, label: "Installs", suffix: "+" },
{ value: 99.9, label: "Uptime", suffix: "%", decimals: 1 },
]}
/>import { StatsBandMotion } from "@/components/custom/stats-band/stats-band-motion";
<StatsBandMotion stats={stats} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| stats* (required) | { value; label; prefix?; suffix?; decimals? }[] | – | 2 to 4 read best. Use real numbers. |
| title | string | – | Heading (h2). |
| description | string | – | Line under the heading. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| stats* (required) | { value; label; prefix?; suffix?; decimals? }[] | – | 2 to 4 read best. Use real numbers. |
| title | string | – | Heading (h2). |
| description | string | – | Line under the heading. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- A description list: each label is the term and the number its value.
- Numbers format with a fixed locale, so server and browser match.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.