{"slug": "xstate", "name": "XState", "category": "dev-libs", "category_name": "Libraries and frameworks", "description": "", "recommenders": 3, "commenters": 7, "warners": 1, "score": 2.323, "rising": -0.98, "first": "2025-12-16", "latest": "2026-04-26", "why": "I love XState. It has solved so many problems in quite a few codebases for me", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 4, "neutral": 1, "compare": 2, "warn": 1}, "spark": [0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0], "listed": true, "loved": [], "caveat": "", "short_quote": "I love XState. It has solved so many problems in quite a few codebases for me", "kind": "", "icon": false, "domain": null, "github_repo": "github.com/statelyai/xstate", "official_url": "https://stately.ai", "pricing": "", "aliases": ["XState"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 766666000, "item_id": 47916625, "url": "https://news.ycombinator.com/item?id=47916625", "by": "davemo", "date": "2026-04-26", "stance": "recommend", "quote": "I love XState. It has solved so many problems in quite a few codebases for me", "excerpt": "I love XState. It has solved so many problems in quite a few codebases for me, most recently it has become the backbone of a voice app I'm building for the banking sector. Thank you for all the time and effort you put into making it great. I blogged[0] a bit about my experience with Finite State Machines, and about the architecture we landed on with XState and Mastra (although since publishing we have swapped to Pipe", "context": "building a voice app for banking", "use_case": "state machines in voice app", "switched_from": "", "story": "Statecharts: hierarchical state machines"}, {"id": 760009600, "item_id": 47500600, "url": "https://news.ycombinator.com/item?id=47500600", "by": "dleeftink", "date": "2026-03-24", "stance": "recommend", "quote": "machines are a little more intuitive than the conditional value structuring", "excerpt": "Think Xstate[0] machines are a little more intuitive than the conditional value structuring displayed here in the example, but it is an interesting idea indeed. [0]: https://github.com/statelyai/xstate?tab=readme-ov-file#super-quick-start", "context": "", "use_case": "state machines", "switched_from": "", "story": "No-build, no-NPM, SSR-first JavaScript framework if you hate React, love HTML"}, {"id": 757245440, "item_id": 47327840, "url": "https://news.ycombinator.com/item?id=47327840", "by": "steve_adams_86", "date": "2026-03-10", "stance": "recommend", "quote": "so XState is an excellent option", "excerpt": "This seems very post-hoc and like they're fortunate they happened to arrive at something better rather than worse. The justification for K8s seems pretty thin. It makes me wonder if the author understands why they need it. I'm guessing it's because they've got substantial parallel, multi-tenant networking of stateful processes, which is a pretty defensible reason to use K8s. And easy to say. It seems strange to leave", "context": "", "use_case": "serializable state machines", "switched_from": "", "story": null}, {"id": 750876192, "item_id": 46929762, "url": "https://news.ycombinator.com/item?id=46929762", "by": "steve_adams_86", "date": "2026-02-07", "stance": "recommend", "quote": "XState, which has a beautiful visualizer/simulator", "excerpt": "The configuration reminds me a lot of XState, which has a beautiful visualizer/simulator (with a new version on the way I think): https://stately.ai/viz This is cool too! I love state machines.", "context": "", "use_case": "state machines", "switched_from": "", "story": "Show HN: Browser based state machine simulator and visualizer"}]}], "caveats": [{"label": "", "summary": "", "quotes": [{"id": 766570560, "item_id": 47910660, "url": "https://news.ycombinator.com/item?id=47910660", "by": "gedge", "date": "2026-04-26", "stance": "warn", "quote": "the overhead of understanding the bits and bobs of xstate was too high of a cost for any perceivable benefit it may have offered", "excerpt": "I love statecharts, but I wanted to challenge some of the \"why\"s in this post. > It\u2019s easier to understand a statechart than many other forms of code. There's a lot of arguable quantifiers here, but when I was started at https://gadget.dev (no longer working there), we started with hierarchical statecharts as a way for users to specify their behaviour (with the ability to customize transitions with code snippets). No", "context": "former engineer at Gadget", "use_case": "backend state machines", "switched_from": "XState", "story": "Statecharts: hierarchical state machines"}]}], "who": [{"by": "davemo", "context": "building a voice app for banking", "url": "https://news.ycombinator.com/item?id=47916625", "date": "2026-04-26"}], "tags": [], "use_cases": ["state machines", "state machines in voice app", "backend state machines", "serializable state machines"], "compared": [], "makers": [{"id": 766558336, "item_id": 47909896, "url": "https://news.ycombinator.com/item?id=47909896", "by": "egeozcan", "date": "2026-04-26", "stance": "recommend", "quote": "I had used (and would gladly still use) XState", "excerpt": "I had used (and would gladly still use) XState, without even knowing about what \"statecharts\" even means. I used it with lit.js to help with a drawer-like navigation component that reacts to page width and has many props and internal states. I can't even think how horrible it'd have been without XState. Thank you very much!", "context": "Creator of XState; working on it 10+ years", "use_case": "State machines and statecharts", "switched_from": "", "story": "Statecharts: hierarchical state machines"}, {"id": 766553376, "item_id": 47909586, "url": "https://news.ycombinator.com/item?id=47909586", "by": "davidkpiano", "date": "2026-04-26", "stance": "recommend", "quote": "I created XState, a JS/TS library for authoring, executing, and visualizing state machines/statecharts", "excerpt": "Glad to see statecharts still getting attention! I created XState, a JS/TS library for authoring, executing, and visualizing state machines/statecharts: https://github.com/statelyai/xstate I've been working on it for 10+ years. The main thing I've learned is that statecharts are most valuable when they're treated as executable behavior, not just documentation. That doesn't mean you need to use them everywhere or mode", "context": "", "use_case": "Executable statecharts / state machines", "switched_from": "", "story": "Statecharts: hierarchical state machines"}], "threads": [{"url": "https://news.ycombinator.com/item?id=47908833", "title": "Statecharts: hierarchical state machines", "mentions": 6}, {"url": "https://news.ycombinator.com/item?id=46868879", "title": "Show HN: Browser based state machine simulator and visualizer", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=47439413", "title": "No-build, no-NPM, SSR-first JavaScript framework if you hate React, love HTML", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47324691", "title": "item 47324691", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=46286407", "title": "A2UI: A Protocol for Agent-Driven Interfaces", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {"neutral": 1}, "2026-01": {}, "2026-02": {"recommend": 1, "compare": 1}, "2026-03": {"recommend": 2}, "2026-04": {"warn": 1, "compare": 1, "recommend": 1}, "2026-05": {}, "2026-06": {}, "2026-07": {}, "2026-08": {}, "2026-09": {}, "2026-10": {}}, "quotes": [{"id": 766666000, "item_id": 47916625, "url": "https://news.ycombinator.com/item?id=47916625", "by": "davemo", "date": "2026-04-26", "stance": "recommend", "quote": "I love XState. It has solved so many problems in quite a few codebases for me", "excerpt": "I love XState. It has solved so many problems in quite a few codebases for me, most recently it has become the backbone of a voice app I'm building for the banking sector. Thank you for all the time and effort you put into making it great. I blogged[0] a bit about my experience with Finite State Machines, and about the architecture we landed on with XState and Mastra (although since publishing we have swapped to Pipe", "context": "building a voice app for banking", "use_case": "state machines in voice app", "switched_from": "", "story": "Statecharts: hierarchical state machines"}, {"id": 766577953, "item_id": 47911122, "url": "https://news.ycombinator.com/item?id=47911122", "by": "davidkpiano", "date": "2026-04-26", "stance": "compare", "quote": "", "excerpt": "There is also @xstate/store for simple event-driven stores and atoms; just as simple as Zustand + Jotai: https://stately.ai/docs/xstate-store", "context": "", "use_case": "", "switched_from": "", "story": "Statecharts: hierarchical state machines"}, {"id": 766575072, "item_id": 47910942, "url": "https://news.ycombinator.com/item?id=47910942", "by": "c01nd01r", "date": "2026-04-26", "stance": "compare", "quote": "With all respect to xstate, if you don't need complex nested state machines", "excerpt": "With all respect to xstate, if you don't need complex nested state machines, you should check out robot3.js. The automatic TS type inference makes it pretty handy for the spots where you want a bit of state machine logic.", "context": "", "use_case": "", "switched_from": "", "story": "Statecharts: hierarchical state machines"}, {"id": 766570560, "item_id": 47910660, "url": "https://news.ycombinator.com/item?id=47910660", "by": "gedge", "date": "2026-04-26", "stance": "warn", "quote": "the overhead of understanding the bits and bobs of xstate was too high of a cost for any perceivable benefit it may have offered", "excerpt": "I love statecharts, but I wanted to challenge some of the \"why\"s in this post. > It\u2019s easier to understand a statechart than many other forms of code. There's a lot of arguable quantifiers here, but when I was started at https://gadget.dev (no longer working there), we started with hierarchical statecharts as a way for users to specify their behaviour (with the ability to customize transitions with code snippets). No", "context": "former engineer at Gadget", "use_case": "backend state machines", "switched_from": "XState", "story": "Statecharts: hierarchical state machines"}, {"id": 760009600, "item_id": 47500600, "url": "https://news.ycombinator.com/item?id=47500600", "by": "dleeftink", "date": "2026-03-24", "stance": "recommend", "quote": "machines are a little more intuitive than the conditional value structuring", "excerpt": "Think Xstate[0] machines are a little more intuitive than the conditional value structuring displayed here in the example, but it is an interesting idea indeed. [0]: https://github.com/statelyai/xstate?tab=readme-ov-file#super-quick-start", "context": "", "use_case": "state machines", "switched_from": "", "story": "No-build, no-NPM, SSR-first JavaScript framework if you hate React, love HTML"}, {"id": 757245440, "item_id": 47327840, "url": "https://news.ycombinator.com/item?id=47327840", "by": "steve_adams_86", "date": "2026-03-10", "stance": "recommend", "quote": "so XState is an excellent option", "excerpt": "This seems very post-hoc and like they're fortunate they happened to arrive at something better rather than worse. The justification for K8s seems pretty thin. It makes me wonder if the author understands why they need it. I'm guessing it's because they've got substantial parallel, multi-tenant networking of stateful processes, which is a pretty defensible reason to use K8s. And easy to say. It seems strange to leave", "context": "", "use_case": "serializable state machines", "switched_from": "", "story": null}, {"id": 751189136, "item_id": 46949321, "url": "https://news.ycombinator.com/item?id=46949321", "by": "sridhar87", "date": "2026-02-09", "stance": "compare", "quote": "My plan is to build a slightly orthogonal version of what stately / xstate offers", "excerpt": "Thanks for checking out. Actually I didn't know of XState when I built this, I had built this for my own workflow. I did use AI to build this, so credits to AI for coming up with the right model, inspired by XState. My plan is to build a slightly orthogonal version of what stately / xstate offers, even though right now it looks similar. You can check out eigenarc.com for how I'm thinking of this.", "context": "", "use_case": "", "switched_from": "", "story": "Show HN: Browser based state machine simulator and visualizer"}, {"id": 750876192, "item_id": 46929762, "url": "https://news.ycombinator.com/item?id=46929762", "by": "steve_adams_86", "date": "2026-02-07", "stance": "recommend", "quote": "XState, which has a beautiful visualizer/simulator", "excerpt": "The configuration reminds me a lot of XState, which has a beautiful visualizer/simulator (with a new version on the way I think): https://stately.ai/viz This is cool too! I love state machines.", "context": "", "use_case": "state machines", "switched_from": "", "story": "Show HN: Browser based state machine simulator and visualizer"}, {"id": 740637728, "item_id": 46289858, "url": "https://news.ycombinator.com/item?id=46289858", "by": "uptownhr", "date": "2025-12-16", "stance": "neutral", "quote": "My approach/prototype using XState with websockets from an MCP server", "excerpt": "My approach/prototype using XState with websockets from an MCP server https://github.com/uptownhr/mcp-agentic-ui", "context": "", "use_case": "", "switched_from": "", "story": "A2UI: A Protocol for Agent-Driven Interfaces"}]}