# CountUp

Numbers that count — eased value animation with tabular figures, prefixes and suffixes.

- Family: Feedback, imported from `mizu-ui` or `mizu-ui/feedback`
- Docs: https://mizu.user64bit.world/components/count-up
- Source: https://github.com/0xuser64bit/mizu/blob/main/packages/mizu/src/feedback/CountUp.tsx

## Usage

```tsx
import { CountUp } from "mizu-ui";

export function Stat() {
  return <CountUp value={1284} duration={1.4} suffix="+" />;
}
```

## Copy it with the shadcn CLI

```sh
npx shadcn@latest init 0xuser64bit/mizu/preset # once, where there is no components.json
npx shadcn@latest add 0xuser64bit/mizu/count-up
```

## Props

- `value`: `number`. Target value. Animates from the previous value on change.
- `duration`: `number` (default `1.2`). Animation duration in seconds.
- `delay`: `number` (default `0`). Start delay in seconds.
- `decimals`: `number` (default `0`). Fraction digits, clamped to 0–20.
- `prefix / suffix`: `string` (default `""`). Affixes rendered outside the animation.

## Accessibility

The final value is separate screen-reader text; the changing visual figures are aria-hidden. Reduced motion renders the final number directly.

## Motion

Quartic ease-out on a rAF loop. Reduced motion sets the value instantly.
