CountUp
Numbers that count — eased value animation with tabular figures, prefixes and suffixes.
Live — this one is real
259
Pieces in the archive
128+
States per component
100%
Reduced-motion safe
Usage
import { CountUp } from "mizu-ui";
export function Stat() {
return <CountUp value={1284} duration={1.4} suffix="+" />;
}
Source & setup
Add this component to your project with the shadcn CLI. The command copies its source into your configured UI directory, with its source module’s stylesheet and base.css, Mizu’s tokens. In a project without a components.json, run npx shadcn@latest init 0xuser64bit/mizu/preset first: plain init installs shadcn’s theme into your global CSS. Then load the fonts.
npx shadcn@latest add 0xuser64bit/mizu/count-upEvery component imports from its own path, its name in kebab case.
import { CountUp } from "@/components/ui/mizu/count-up";For npm imports, import mizu-ui/styles.css once. Fonts are optional via mizu-ui/fonts.css. Override --mizu-* tokens or use className for local styling. Requires React and Motion. A Client Component: its source starts with “use client”.
Inspect feedback/CountUp.tsx
Source is included in the npm package under src/feedback/CountUp.tsx.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | — | Target value. Animates from the previous value on change. |
| duration | number | 1.2 | Animation duration in seconds. |
| delay | number | 0 | Start delay in seconds. |
| decimals | number | 0 | Fraction digits, clamped to 0–20. |
| prefix / suffix | string | "" | 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.