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.
npx shadcn@latest add @silicon-ui/stats-bandInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/stats-bandManually
Install the dependencies
npm install motionCopy these files into your project
- components/silicon-ui/blocks/stats-band/stats-band.tsx
- components/silicon-ui/blocks/stats-band/stats-band-data.ts
- components/silicon-ui/blocks/stats-band/stats-band.module.css
- components/silicon-ui/blocks/stats-band/stats-band-world.ts
Shared with other components. Skip any you already have.
- components/silicon-ui/segmented-control/segmented-control.tsx
- components/silicon-ui/segmented-control/segmented-control.module.css
- components/silicon-ui/lib/fluid-hover.tsx
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
StatsBand
| Prop | Type | Default |
|---|---|---|
statsThree or four stats read best. | Stat[] | exampleStats |
layout`plain` lets the stats float on whitespace; `divided` sets them in a hairline grid ruled above and below. | StatsBandLayout
| "plain" |
title | string | — |
description | string | — |
durationSeconds each number takes to count up. Defaults to 1.6. | number | 1.6 |
localeNumber formatting locale. Fixed by default so server and client agree. | string | "en-US" |
className | string | — |
Also accepts the props of HTMLAttributes.
Dependencies
- npm
- motion
- Registry
- silicon-motion-tokenssegmented-control