Machine

Edit and step through a flat deterministic state machine.

Current state
Statesidle · loading · success · error

Valid machine definition

532/6000

Flat deterministic states only. Edit states, initial and from/event/to transitions; no guards, actions or nested states.

What it measures

Machine shows the active state and the events that are valid from it. The built-in example moves between idle, loading, success and error. An event with no matching transition leaves the state unchanged in the pure model, but only available events get buttons.

How it is computed

The JSON defines one initial state and unique from/event/to edges. Validation rejects missing targets, duplicate state-event pairs, unsupported fields and size limits. The next state comes from that single matching edge. This is a finite-state machine, deliberately limited to a flat deterministic subset.

When to use it

Use it to make a small interaction’s allowed outcomes explicit. Invalid edits show an error and cannot run. Guards, actions, hierarchy, parallel states and history are outside this tool.

Export uses the same definition to produce static XState configuration JSON or a plain JavaScript transition function.