Skip to content

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

Import mizu-ui/styles.css once. Fonts are optional via mizu-ui/fonts.css. Override --mizu-* tokens or use className for local styling. Uses native React and CSS; install the package peers for root imports.

Inspect feedback/CountUp.tsx

Source is included in the npm package under src/feedback/CountUp.tsx.

Open full source ↗

Props

PropTypeDefaultDescription
valuenumber—Target value. Animates from the previous value on change.
durationnumber1.2Animation duration in seconds.
delaynumber0Start delay in seconds.
decimalsnumber0Fraction digits, clamped to 0–20.
prefix / suffixstring""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.

Works alongside