xstate

Finite State Machines and Statecharts for the Modern Web.

Explicit state machines and statecharts.

When to choose it: Complex flows (wizards, async sequences, UI with many states) where you want logic that is explicit, testable and visualizable.

  • + Impossible states become impossible
  • + Visualizable logic
  • + Framework-agnostic
  • - Steepest learning curve here
  • - Overkill for simple state
Latest version
5.32.0
Monthly downloads
20,263,809
GitHub stars
29,666
Minified + gzip
14.1 kB
Dependencies
0
License
MIT

Compare xstate with

Data from npm, Bundlephobia and GitHub. Last updated 2026-06-02.