Learn about states, transitions, events, actions, and actors in the Stately Studio.
A state describes a state 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.
When a state machine starts, it enters the initial state first. A machine can only have one top-level initial state. Parent states also have initial states.
When a machine reaches the final state, it can no longer receive any events, and anything running inside it is canceled and cleaned up.
Parent states can contain more states, also known as child states. These child states are only active when the parent state is active.
In statecharts, a parallel state is a state separated into multiple regions of child states, where each region is active simultaneously.
In statecharts, a history state returns the parent state to its most recently active child state. The box with an H inside represents the history state.