NumberFlow (React)

An animated number component for React that transitions digits, formats locales, and respects reduced-motion preferences

Library
npm
v0.6.2
7,717 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
71 /100 Good
Development Activity 72
Maintenance 80
Community 48
Maturity 44
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
82 /100 Excellent
Architecture 85
Code Quality 82
Innovation 83
Learning Curve 78

NumberFlow is a React component that animates transitions between numeric values, spinning individual digits in and out and re-flowing grouping/decimal characters the way an odometer would. Under the hood it wraps a framework-agnostic custom element (number-flow-lite) so the same core rendering and diffing logic is shared across the project’s React, Vue, and Svelte packages. It formats numbers with Intl.NumberFormat, so locale, currency, percentage, and compact-notation formatting all work out of the box while the animation layer only replays the parts of the number that actually changed.

Beyond the basic value transition, NumberFlow ships a NumberFlowGroup for synchronizing multiple counters that update together (e.g. a price and its per-unit breakdown), continuous/trend plugins for stock-ticker-style motion, and first-class SSR support so the initial render is not blank before hydration. It automatically respects prefers-reduced-motion and falls back to a plain text swap when the browser can’t animate, making it a practical fit for dashboards, pricing pages, and any UI element that needs to draw attention to a changing count without feeling gimmicky.

What You Get

  • A drop-in <NumberFlow value={...} /> component that animates between any two numbers using Intl.NumberFormat options for locale, currency, and precision
  • A NumberFlowGroup component for keeping multiple related counters visually synchronized during simultaneous updates
  • Built-in respect for prefers-reduced-motion, with automatic fallback to non-animated rendering
  • SSR-safe rendering via a shared custom-element core so the first paint already shows the correct formatted number
  • Plugins (e.g. continuous/trend) for stock-ticker-like motion and directional animation cues
  • Framework parity — the same core engine also powers @number-flow/vue and @number-flow/svelte packages in the same monorepo

Common Use Cases

  • Animating price or total changes in checkout and cart summaries
  • Live-updating dashboard KPIs, stats, and counters
  • Stock ticker or crypto price displays with trend-aware motion
  • Gamified UI elements like scores, streaks, or leaderboard positions

Under The Hood

Architecture - The monorepo (packages/number-flow, packages/react, packages/vue, packages/svelte) centers on a framework-agnostic custom element defined in number-flow/lite, which handles formatting a value into structured Data (via formatToData) and diffing/animating the DOM between renders. @number-flow/react’s NumberFlow.tsx registers a NumberFlowElement custom element subclass once, then wraps it in a class component (NumberFlowImpl) that uses getSnapshotBeforeUpdate/componentDidUpdate to call willUpdate()/didUpdate() around the custom element exactly when data changes, letting the underlying element manage the actual digit transition animations. A NumberFlowGroup context coordinates multiple instances so simultaneous updates animate in lockstep.

Tech Stack - Pure TypeScript, built with tsup and a pnpm workspace (pnpm-workspace.yaml). React support spans React 16-19 with explicit shims (isReact19 branches) to handle differences in custom-element attribute handling and JSON serialization of props between versions. The core relies on the standard Intl.NumberFormat API for locale/currency formatting rather than a bundled formatting library, keeping the dependency footprint minimal (only esm-env for browser detection).

Code Quality - The test-suites/wrapper directory contains a substantial Vitest suite (render, SSR, update, animated, group, nonce, hashes, can-animate) with snapshot fixtures per test, covering cross-framework behavior consistently. Code is compact and heavily commented at tricky workaround points (e.g. React 19 attribute-changed-callback differences), which aids maintainability given the DOM/React interop complexity involved.

API Design - The public API is intentionally small: a single <NumberFlow value={...} /> component with optional locales/format props mirroring Intl.NumberFormatOptions, plus a NumberFlowGroup wrapper for coordinated groups. Because formatting options map directly onto the standard Intl API, there is no bespoke format mini-language to learn, and the component works as a near drop-in replacement for a plain {value} render, keeping the barrier to adoption low.

Used by 15 apps in this directory

Rust
65%
Apache 2.0

agentgateway

AI Development · Developer Tools · Mcp

5,071

An open source AI-native proxy that secures, observes, and governs agent-to-LLM, agent-to-tool, and agent-to-agent communication through MCP, A2A, and unified LLM routing.

View details
88
Repo Health
82
Technical
69
Dependency
Built with
Rust 65%
Go 23%
Updated 5 days ago
TypeScript
89%
Other

anytype-ts

Collaboration · Knowledge Management · Note Taking

8,861

A local-first, end-to-end encrypted knowledge OS that lets you build notes, tasks, wikis, and entire apps — with your data stored offline and synced peer-to-peer.

View details
88
Repo Health
78
Technical
67
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
Python
66%
Other

AutoGPT

AI Assistants · Automation · Productivity

187,596

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
66
Dependency
Built with
Python 66%
TypeScript 33%
Updated 4 days ago
Rust
54%
Other

Cap

Team Chat · Video Conferencing

22,884

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
64
Dependency
Built with
Rust 54%
TypeScript 42%
Updated 4 days ago
TypeScript
100%
Other

Dub

Analytics · Marketing

24,835

The open-source link attribution platform for short links, conversion tracking, and affiliate programs — powering 100M+ clicks monthly.

View details
81
Repo Health
78
Technical
62
Dependency
Built with
TypeScript 100%
Updated 4 days ago
TypeScript
51%
MIT

Ghost

Blogging · CMS

55,450

Open source headless Node.js CMS for professional publishing, paid memberships, and newsletters with a fully owned audience.

View details
96
Repo Health
85
Technical
67
Dependency
Built with
TypeScript 51%
JavaScript 44%
Updated 4 days ago
TypeScript
96%
AGPL 3.0

Midday

Invoicing Finance · Productivity

15,042

All-in-one AI-powered business operations platform for freelancers and solo entrepreneurs to manage invoicing, time tracking, banking, and financial intelligence.

View details
53
Repo Health
78
Technical
67
Dependency
Built with
TypeScript 96%
Updated 3 months ago
Go
56%
Other

Multica

AI Assistants · AI Development

51,481

Turn coding agents into real teammates — assign issues, track progress, and compound reusable skills across a vendor-neutral, self-hosted platform.

View details
87
Repo Health
83
Technical
67
Dependency
Built with
Go 56%
TypeScript 38%
Updated 5 days ago
TypeScript
98%
Other

Novu

Developer Tools

40,084

Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers