Skip to content
Version: XState v4

States

A state describes the machine’s status or mode, which could be as simple as Paused and Playing. A state machine can only be in one state at a time.

These states are “finite”; the machine can only move through the states you’ve pre-defined.

Create a state

  1. Select your machine or an existing state.
  2. Create a new state inside your machine or existing state:
    • Use the + State button that appears above the selected state, or:
    • Drag from the handles on the left, right and bottom sides of the selected state, and release to create a connecting transition, event and new state.
    • Double-click inside your machine or an existing state.