# Stat Counter

Single metric: a label above a big counting number, an optional up/down delta badge beside it, and a caption underneath.

```bash
npx shadcn add https://www.reelcn.dev/r/stat-counter.json
```

Usage:

```tsx
<Center>
  <StatCounter
    label="Monthly recurring revenue"
    to={48200}
    format={{ style: "currency", currency: "USD", maximumFractionDigits: 0 }}
    delta={12.4}
    caption="vs. last month"
  />
</Center>
```

Use for:

- A headline KPI on its own slide: revenue, active users, churn
- A metric that should show change since last period

Avoid:

- Several metrics together. Use `kpi-grid`
- A bare number with no label. Use `counter`


## Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| delay? | `number` | — | Frames to wait before entering. |
| duration? | `number` | — | Enter duration in frames. Defaults to 0.6s. Some items reuse `duration` for an unrelated local timing. See that item's own prop docs. |
| exit? | `number \| boolean` | — | Exit at the end of the parent `<Sequence>`. `false` keeps it on screen, a number sets the exit length in frames. |
| motion? | `MotionPersonality` | — | Override the theme's motion personality. |
| poster? | `boolean` | — | Renders fully entered, with no exit: for a still frame or thumbnail. Defaults to `false`. |
| holdFrames? | `number` | — | Delays the start of the exit window by this many frames, for a minimum on-screen hold. Defaults to `0`. |
| label | `string` | — |  |
| to | `number` | — |  |
| from? | `number` | `0` |  |
| format? | `NumberFormatOptions` | — | Intl.NumberFormat options. Fraction digits default to however many `from` and `to` have. |
| locale? | `string` | `"en-US"` | Defaults to "en-US", so renders match on every machine. |
| prefix? | `string` | `""` |  |
| suffix? | `string` | `""` |  |
| size? | `number` | `108` | Font size of the number in design units. |
| weight? | `number` | — |  |
| font? | `"mono" \| "heading" \| "body"` | `"heading"` |  |
| color? | `string` | — |  |
| rolling? | `boolean` | `false` | Odometer-style digit wheels instead of a counting number. |
| align? | `"left" \| "right" \| "center"` | `"center"` |  |
| delta? | `number` | — | Percentage change, e.g. `12.4` for "+12.4%" or `-3` for "-3%". Omit to hide the badge. |
| positiveColor? | `string` | — | Badge color when `delta` is zero or positive. |
| negativeColor? | `string` | — | Badge color when `delta` is negative. |
| caption? | `string` | — | Small line under the number, such as "vs. last month". |
| style? | `CSSProperties` | — |  |
| className? | `string` | — |  |