# XState: 7.3 out of 10

A strong pick. 7th of 10 in [State and data fetching](https://elestia.ai/opensource/state-and-data/index.md).

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

- **Overall: 7.3** (likely 6.3 to 8.3)
  - Claude Opus 5.5 (6.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.
  - GPT-6.2 Sol (8.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.
- **Needed by many: 4.5** (likely 3.4 to 5.6)
  - Claude Opus 5.5 (4.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.
  - GPT-6.2 Sol (4.4): 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.
- **Helps a lot: 7.8** (likely 6.7 to 8.7)
  - Claude Opus 5.5 (7.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.
  - GPT-6.2 Sol (8.5): 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.
- **Holds up over time: 7.5** (likely 6.2 to 8.5)
  - Claude Opus 5.5 (7.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.
  - GPT-6.2 Sol (8.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.
- **Used widely: 6.3** (likely 5.2 to 7.4)
  - Claude Opus 5.5 (6.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.
  - GPT-6.2 Sol (6.6): 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.
- **Vouched for: 6.6** (likely 5.2 to 7.7)
  - Claude Opus 5.5 (6.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.
  - GPT-6.2 Sol (7.1): 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.
- **Safe: 8.6** (likely 7.5 to 9.5)
  - Claude Opus 5.5 (8.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.
  - GPT-6.2 Sol (8.6): 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.

## 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

- Downloads, 4 weeks: 33M
- In a year: ×3.2
- GitHub stars: 31k
- Commits, 12 months: 649
- Last npm release: Nov 2026
- Advisories, 24 months: 0
- Licence: MIT
- GitHub: https://github.com/statelyai/xstate
- npm: https://www.npmjs.com/package/xstate

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 21 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
