AnimateNumber
AnimateNumber is a lightweight (2.5kb) React component for creating beautiful number animations with Motion. It's perfect for counters, dynamic pricing, countdowns, and more.
Built on top of Motion's powerful layout animations, AnimateNumber allows you to leverage all of Motion's existing transition settings, like spring and tween, to create fluid and engaging effects.
AnimateNumber is exclusive to Motion+ members. Motion+ is a one-time payment, lifetime membership that unlocks exclusive components, premium examples and access to a private Discord community.
Features
Built on Motion: Leverages Motion's robust animation engine, allowing you to use familiar
transitionprops likespring,duration, andease.Lightweight: Adds only 2.5kb on top of Motion.
Advanced formatting: Uses the built-in
Intl.NumberFormatfor powerful, locale-aware number formatting (e.g., currency, compact notation).Customisable: Provides distinct CSS classes for each part of the number (prefix, integer, fraction, suffix) for full styling control.
Install
First, add the motion-plus package to your project using your private token. You need to be a Motion+ member to generate a private token.
Usage
AnimateNumber accepts a single child, a number.
When this number changes, it'll animate to its latest value.
Customise animation
The transition prop accepts Motion for React's transition options.
transition accepts value-specific transition settings, so it's possible to set specific transitions for layout, y and opacity:

