XState
A strong pick. 7th of 10 state and data fetching.
XState is a framework-agnostic library of state machines, statecharts and actors. It is the strongest tool in this category for complex, multi-step logic, but it is too heavy for everyday app state and does not fetch server data. v5 is stable and actively maintained. A v6 alpha with breaking changes is already published, so plan for another migration.
Best for: Teams with complex, long-lived flows (wizards, checkout, media players, agent loops) that want those flows explicit, typed, visual and testable.
Scores
Overall7.3
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 6.5, likely 5.5 to 7.5
For complex flows, it is clearly the best tool in the category and well maintained, which supports a strong pick for that kind of project. For most apps, Zustand, Jotai or TanStack Query do this category's job more simply. Its below-median growth and the coming v6 breaking changes also keep it out of the 7-8 range for general use.
- peers downloads: Zustand, TanStack Query and Redux Toolkit grow about 6.5-7x; XState grows 3.2x.
- stately.ai/docs/xstate/v6/xstate-v5-to-v6: Another major migration is ahead.
- dev.to/mauriciord/xstate-my-practical-experience-and-insights-4d4d: Worth it for complex apps; overkill otherwise.
GPT-6.2 Sol: 8.1, likely 7.0 to 9.1
XState v5 is a strong choice when an app needs explicit rules for what can happen in each state and when asynchronous work starts or stops. Zustand is easier for simple shared state, and TanStack Query handles server-data freshness with less application code. Active maintenance supports a new adoption today, with slower relative download growth and future major-version migration costs tempering the recommendation.
- github.com/statelyai/xstate/releases/tag/xstate%405.33.4: Recent stable release ships a TypeScript fix
- frontendundefined.com/posts/monthly/xstate-in-react: Firsthand comparison of workflow clarity and setup cost
- mahcin.com/state-management: Independent comparison of workflow, shared-state, and server-cache tools
- npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo, and medianDownloadsRatio: Download growth trails the catalog baseline
- dev.stately.ai/docs/xstate/v6/xstate-v5-to-v6: Documents the cost of the next major upgrade
Needed by many4.5
How many developers need a tool for this job?
Claude Opus 5.5: 4.5, likely 3.5 to 5.5
Most apps need state management, but XState's job is a narrower one: complex event-driven logic. Users and reviewers agree that most projects can use simpler stores. It does not cover server-data fetching. Running on any framework and on the server widens it a little.
- dev.to/mauriciord/xstate-my-practical-experience-and-insights-4d4d: Calls it overkill for simple transitions and a fit for complex, long-lived apps.
- github.com/statelyai/xstate/discussions/4708: A team removed it because their app was too simple to need it.
- github description: Describes itself as being for complex logic, not general app state.
GPT-6.2 Sol: 4.4, likely 3.3 to 5.6
XState runs across frameworks and on both the client and server. Its strongest fit is the subset of apps with branching workflows, concurrent steps, or strict transition rules. The React survey helps establish how common simpler approaches are, while the share of projects that need statecharts remains uncertain.
- stately.ai/docs/xstate/v5: Framework integrations and client and server support
- 2025.stateofreact.com/en-US/libraries/state-management: Many respondents rely on built-in React state tools
- news.ycombinator.com/item?id=42483871: Users describe the payoff for transaction flows and complex interfaces
Helps a lot7.8
How well does it do the job for those who need it?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
Within its niche it is the most complete tool: hierarchical and parallel states, actors, persistence, strong TypeScript inference without typegen in v5, and visual tooling. Users report steep learning, verbose code, weak inference when code is split into files, and unreliable AI-generated code because v4 and v5 syntax get mixed. For ordinary app state, Zustand or Jotai do the job with far less code.
- dev.to/mauriciord/xstate-my-practical-experience-and-insights-4d4d: Praises the inspector and diagrams; reports a steep curve, TypeScript pain, and AI assistants mixing v4 and v5.
- stately.ai/blog/2023-12-01-xstate-v5: v5 moved to actors as the main model and persists child actors deeply.
- dev.to/mornir/my-personal-experience-with-xstate-39kd: An adopter's mixed but mostly positive report on real use.
- npm hasTypes: Ships its own types.
GPT-6.2 Sol: 8.5, likely 7.4 to 9.4
Stable v5 combines guarded transitions, nested and parallel states, typed actors, and documented testing and inspection. Users report that explicit transitions make complex flows easier to reason about, while machine definitions add work for simple state. Coding agents can mix v4 and v5 syntax, and routine server caching is easier with TanStack Query. Available speed comparisons cover narrow workloads, so the performance judgment depends on the app.
- stately.ai/docs/xstate/v5/typescript: Typed machine setup and inference
- stately.ai/docs/xstate/v5/testing: Actor tests and inspection of transient transitions
- frontendundefined.com/posts/monthly/xstate-in-react: Independent v5 refactor reports clearer behavior and more verbose definitions
- dev.stately.ai/blog/2026-11-05-xstate-v6-beta: Maintainers report coding agents mixing API generations
- tanstack.com/query/latest/docs/framework/react/guides/important-defaults: TanStack Query provides cache and refetch defaults
- dunky.dev/state-machine/benchmark: Competing maintainer measures snapshot overhead in narrow benchmarks
Holds up over time7.5
Will it still be a good choice in two years?
Claude Opus 5.5: 7.0, likely 5.5 to 8.0
Activity is high: 649 commits and 208 monorepo releases in the last year, only 35 open issues, and a company (Stately) behind it with long-time core maintainers. The risk is churn: a v6 alpha is out that removes core exports and makes v5 snapshots incompatible, so a second big migration in a few years is coming. The company's commercial future and attention to AI agents add some uncertainty.
- github commitsLastYear / releasesLastYear: 649 commits and 208 releases in the last year.
- github openIssues / closedIssues: 35 open against 1424 closed.
- stately.ai/docs/xstate/v6/xstate-v5-to-v6: v6 drops assign/sendTo and has incompatible snapshots; v5 and v6 must be treated as separate libraries.
- stately.ai/docs/xstate/v6/faq: v6 is in alpha; v5 remains the stable choice.
GPT-6.2 Sol: 8.0, likely 6.8 to 9.0
XState published 21 npm versions in the past year, and an outside contributor’s TypeScript fix shipped four days after merge. Stately continues to support v5 while developing v6, and Sanity publicly funds XState. The pace of issue resolution across the project is harder to gauge, and the v6 beta introduces API and snapshot migration work.
- npm versionsLastYear and github commitsLastYear: 21 package versions and 649 commits across the repository
- github.com/statelyai/xstate/pull/5827: Outside contributor’s typing fix merged on November 3
- github.com/statelyai/xstate/releases/tag/xstate%405.33.4: Typing fix shipped in the November 7 patch
- sanity.io/blog/open-source-pledge-2025: Sanity names XState as a sponsorship recipient
- dev.stately.ai/blog/2026-11-05-xstate-v6-beta: Continued v5 support and a v6 migration tool
- dev.stately.ai/docs/xstate/v6/xstate-v5-to-v6: Breaking API and persisted snapshot changes
Used widely6.3
How many use it, and is that growing?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
33M downloads in four weeks, up 3.2x from a year ago, puts it close to Jotai, Pinia and Apollo. It is far behind Zustand and TanStack Query, and its growth is below the 4.1 median, so it is losing share. Its 107k dependent repos are high, second only to Redux Toolkit, which shows broad real use, though some of that comes through other tools that depend on it.
- npm downloadsLast4Weeks / downloadsSame4WeeksYearAgo: 33.0M against 10.3M, a ratio of 3.2, below the 4.1 median.
- dependents repos: 107,428 dependent repos, more than every peer except Redux Toolkit.
- github stars: 30.5k stars.
- bluesky posts: Only 4 posts, low attention compared with peers.
GPT-6.2 Sol: 6.6, likely 5.3 to 7.8
Ecosyste.ms found about 107,000 dependent repositories, second to Redux Toolkit among the supplied peers. Four-week downloads climbed from 10.3 million to 33.0 million, or 3.22×, below the 4.10× catalog median and well behind Zustand and TanStack Query. Automated and indirect installs blur the count of teams choosing XState, and social signals are sparse.
- dependents repos and packages: 107,428 repositories and 835 packages in a partial index
- npm downloadsLast4Weeks, npm downloadsSame4WeeksYearAgo, and medianDownloadsRatio: 3.22× year-over-year growth against the 4.10× baseline
- peers: Second in indexed repositories, with slower download growth than the leading peers
- github stars, bluesky posts, and hackerNews top: 30,523 repository-wide stars and limited recent discussion, including a separate XState Store story
- npmjs.com/package/xstate?activeTab=code: Related packages can bring in XState through peer dependencies
Vouched for6.6
Who stands behind it being good?
Claude Opus 5.5: 6.0, likely 4.5 to 7.0
It is the best-known statecharts library in JavaScript, with many independent write-ups by developers who use it in production, and peers such as TkDodo have written about XState Store. I found no current survey satisfaction data, and recent independent reviews are few. Several of them say it is good but only for complex cases.
- iamjoshcarter.pages.dev/articles/refactoring-a-monstrosity-using-xstate-5: An independent production refactor with XState 5.
- hackerNews top: Modest HN attention, including TkDodo's XState Store post.
- heise.de/-11197819: State of React coverage highlights TanStack Query and Zustand, not XState.
GPT-6.2 Sol: 7.1, likely 5.9 to 8.3
A 2026 payments write-up describes using v5 to handle payment states, and Sanity’s Vercel dashboard plugin records an upgrade to v5. Kaltura’s account of concurrent media uploads adds an older production example, and Sanity also backs the library financially. The State of React survey covers XState and identifies Zustand as the satisfaction leader, so the strongest endorsements are still for specific workflows.
- medium.com/@dennis0xwanjiru/moving-beyond-boolean-soup-why-xstate-v5-is-the-honest-way-to-build-payments-65c4ce500b14: Firsthand v5 payment workflow write-up
- github.com/sanity-io/sanity-plugin-dashboard-widget-vercel/blob/main/CHANGELOG.md: Sanity plugin documents its XState v5 upgrade
- medium.com/kaltura-tech/how-we-implemented-a-media-library-with-xstate-and-react-f34b084098ad: Kaltura engineering describes concurrent upload flows
- sanity.io/blog/open-source-pledge-2025: Independent financial backing from Sanity
- 2025.stateofreact.com/en-US/libraries/state-management: Survey includes XState and ranks Zustand first in satisfaction
Safe8.6
How safe is it to depend on?
Claude Opus 5.5: 8.5, likely 7.5 to 9.5
It has zero runtime dependencies, no advisories ever recorded, an MIT licence and an OpenSSF Scorecard of 7.3. Weak checks are Code-Review (5), Security-Policy (0), Fuzzing and CII (0). It has no known supply-chain incidents.
- npm dependencies: 0 dependencies.
- advisories total: 0 advisories.
- scorecard score: 7.3; weak on code review, security policy and fuzzing.
- npm license: MIT.
GPT-6.2 Sol: 8.6, likely 7.4 to 9.5
The MIT-licensed core has zero runtime dependencies and no advisories in the supplied OSV record. The tagged GitHub Actions workflow uses npm trusted publishing, and npm lists two human collaborators and a release bot. The 7.3 Scorecard shows mixed code review coverage, with no detected fuzzing or public security policy.
- npm dependencies and license: Zero runtime dependencies and a permissive MIT licence
- advisories total and last24Months: Zero OSV advisories in the snapshot
- scorecard score and checks: 7.3 overall, with code review at 5 and fuzzing and security policy at 0
- github.com/statelyai/xstate/blob/xstate%405.33.4/.github/workflows/publish.yml: Tagged workflow uses GitHub Actions and OIDC for trusted publishing
- npmjs.com/package/xstate?activeTab=dependencies: npm lists two human collaborators and the release bot
Good
- It models complex flows explicitly as statecharts and actors, which makes impossible states and race conditions easier to rule out.
- It has zero runtime dependencies, an MIT licence and no known advisories.
- It works with any framework and on both front end and back end, with adapters for React, Vue, Svelte and Solid, and it has a visual inspector and editor.
- It is very actively maintained by the Stately team, with hundreds of commits and frequent releases in the last year.
Bad
- The learning curve is steep, and it is overkill for the simple UI state that most apps have.
- The v4-to-v5 changes and the coming v6 alpha mean repeated migrations, and AI coding assistants often mix up syntax across versions.
- It has no server-data caching or refetching, so it covers only half of this category's job.
- Download growth (3.2x) lags the median and the leading peers (about 6.5-7x for Zustand, TanStack Query and Redux Toolkit).
The numbers
- npm downloads, 4 weeks
- 33M ×3.2 in a year
- GitHub stars
- 31k
- Commits, 12 months
- 649
- npm version
- 5.33.4 Nov 2026
- Versions, 12 months
- 21
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- 7.3 out of 10, Nov 2026
- Licence
- MIT
Read on 21 November 2026 from GitHub (statelyai/xstate), npm (xstate), OSV and the OpenSSF Scorecard.
State and data fetching
- 9.0TanStack Query
- 8.5Zustand
- 8.0Pinia
- 7.6Jotai
- 7.6Redux Toolkit
- 7.5Apollo Client
- 7.3XState
- 7.0SWR
- 6.7MobX
- 6.5Valtio