Three or four headline numbers that count up as the band scrolls into view, with labels and a footnote for where the numbers come from.
- Runs per day
- Uptime proof
- Usage milestones
- Headline numbers
Examples
Installation
npx knowns-ui@latest add stats-bandPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Stats band from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/stats-band
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add stats-band
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/animated-number.tsx
- components/ui/knowns/chart/chart.tsx
- components/ui/knowns/chart/chart-utils.ts
- components/ui/knowns/chart/sparkline.tsx
- components/ui/knowns/chart/chart-radial.tsx
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- components/ui/knowns/illustrations/illust-utils.ts
- components/ui/knowns/illustrations/use-in-view.ts
- components/ui/knowns/marquee/marquee.tsx
- components/ui/knowns/marquee/marquee-utils.ts
- components/ui/knowns/blocks/marketing/section-heading.tsx
- components/ui/knowns/blocks/marketing/marketing-utils.ts
- components/ui/knowns/text-animation/text-core.tsx
- components/ui/knowns/text-animation/number-ticker.tsx
- components/ui/knowns/blocks/marketing/stats-band.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/stats-band, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "stats-band" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- stats
{ value, label, prefix?, suffix?, format?, detail?, visual?, context? }[]- value is a number; format takes Intl.NumberFormat options (compact, decimals, currency). Labels key the list.
- stats[].visual
{ kind: "trend", values }|{ kind: "bars", values }|{ kind: "distribution", bins, marker? }- A tiny proof chart under the number, in one ink colour. trend: a line over time. bars: one bar per period (scaled between the lowest and highest value, e.g. daily uptime). distribution: a histogram; marker (0 to 1) is where the number sits.
- stats[].context
ReactNode- A line that fades in on hover or focus where a mouse is present, and is always shown on touch screens. Its space is reserved, so nothing moves. The cell takes focus when it has one.
- footnote
ReactNode- Where the numbers come from, and when.
- tone
"plain"|"card"|"divided"- Default
"plain" - Numbers on the page with a hairline on the left, a framed panel with dividers, or a hairline grid.
- eyebrow / title / lead
ReactNode- An optional heading.
| Prop | Type | Default | Description |
|---|---|---|---|
| stats | { value, label, prefix?, suffix?, format?, detail?, visual?, context? }[] | - | value is a number; format takes Intl.NumberFormat options (compact, decimals, currency). Labels key the list. |
| stats[].visual | { kind: "trend", values } | { kind: "bars", values } | { kind: "distribution", bins, marker? } | - | A tiny proof chart under the number, in one ink colour. trend: a line over time. bars: one bar per period (scaled between the lowest and highest value, e.g. daily uptime). distribution: a histogram; marker (0 to 1) is where the number sits. |
| stats[].context | ReactNode | - | A line that fades in on hover or focus where a mouse is present, and is always shown on touch screens. Its space is reserved, so nothing moves. The cell takes focus when it has one. |
| footnote | ReactNode | - | Where the numbers come from, and when. |
| tone | "plain" | "card" | "divided" | "plain" | Numbers on the page with a hairline on the left, a framed panel with dividers, or a hairline grid. |
| eyebrow / title / lead | ReactNode | - | An optional heading. |
Numbers count up once, when the band comes into view, in a reserved space, so nothing reflows. With reduced motion they show their final value. Use numbers you can source, and say where they come from.
What it handles
- 01Shows 3 or 4 headline numbers, each with a value, a label, a prefix, a suffix and Intl.NumberFormat options such as compact notation.
- 02Rolls every number up from 0 with NumberTicker when the band scrolls into view.
- 03Draws a small proof visual under a number: a trend line, daily bars scaled between the lowest and highest value, or a distribution with a marker.
- 04Reveals a context line on hover or focus where a mouse is present, shows it always on touch screens, and reserves its space so nothing moves.
- 05Makes a cell with a context line focusable, so keyboard users reach the same line.
- 06Comes in plain, card and divided tones, and adds a footnote under the band for the source of the numbers.
States
- Scrolls into view
- Each number counts up from 0 to its value
- none
- Context line, hover or focus
- The line fades in where a mouse is present
- 180ms, ease out
- Touch screen
- The context line is already visible
- none
- Proof visual
- The trend, bars or histogram paint as they are
- none
- Reduced motion
- The final numbers show at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| Scrolls into view | Each number counts up from 0 to its value | none |
| Context line, hover or focus | The line fades in where a mouse is present | 180ms, ease out |
| Touch screen | The context line is already visible | none |
| Proof visual | The trend, bars or histogram paint as they are | none |
| Reduced motion | The final numbers show at once | 0ms |
Works with
When to use
When to use
- Three or four numbers that make a point, like usage, uptime or time saved, with a footnote for the source.
When not to use
- Live metrics that change while someone reads: use a dashboard: use Agent Ops Dashboard.
- Numbers you cannot source.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Stats Band to my app and wire it to my own data.
- I need three or four numbers that make a point, like usage, uptime or time saved, with a footnote for the source. Set that up with the Knowns UI Stats Band.
- Which Stats Band props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "stats-band" }) and search_docs({ query: "stats band" }).