# Number Ticker

> Rolls each digit to its new value, like a mechanical counter.

For metrics, prices and live counts. Grouping, decimals and currency come from the locale, and each digit rolls on its own spring.

- Family: Typography
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/number-ticker/
- Licence: https://galactrex.com/ui/license/

## Install

```sh
npx @galactrex/ui login   # once, with an API key from https://galactrex.com/account/
npx @galactrex/ui add number-ticker
```

It installs to `components/galactrex/number-ticker.tsx`, with the shared motion helpers beside it. First time in a project: `npx @galactrex/ui init` (setup guide: https://galactrex.com/docs/ui-components-setup/).

## Usage

```tsx
import { NumberTicker } from "@/components/galactrex/number-ticker";

<NumberTicker value={revenue} format={{ style: "currency", currency: "USD" }} />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `number` | — | The number to show. |
| `locale` | `string` | — | BCP 47 locale; defaults to the visitor's. |
| `format` | `Intl.NumberFormatOptions` | — | e.g. { style: "currency", currency: "USD" }. |
| `stiffness` | `number` | `140` | Spring stiffness of each roll. |
| `className` | `string` | — | Extra classes for the outer element. |

## Variants

- **Count.** Plain integers with grouping.
- **Currency.** Pass `format` with a currency.

## Accessibility

- The formatted value is read once; the rolling digits are aria-hidden.
- Tabular digits keep the width steady.

## Motion

- Each digit is a transform-only roll on a spring.
- Reduced motion: digits change in place.
