Skip to content

Parallel states

A parallel state is a state separated into multiple regions of child states, where each region is active simultaneously.

A dashed line borders each region.

A state machine containing two region states with dashed borders around the outside. The first region is the video state which is active at the same time as the audio state, and contains a playing and stopped state, with stop and play events. The other region is an audio state, which is active at the same time as the video state, and has muted and unmuted states, and unmute and mute events.A state machine containing two region states with dashed borders around the outside. The first region is the video state which is active at the same time as the audio state, and contains a playing and stopped state, with stop and play events. The other region is an audio state, which is active at the same time as the video state, and has muted and unmuted states, and unmute and mute events.

View this machine in the Stately Studio.

In the video player machine above, the video and audio states are active at the same time, which means the following combinations of states can happen simultaneously:

  • video playing, audio muted
  • video playing, audio unmuted
  • video stopped, audio muted
  • video stopped, audio unmuted

Make a state a parallel state

First, select the parent state you want to set as a parallel state. Then…

Using the quick actions menu:

  1. Right-click the state to bring up the quick actions menu.
  2. Choose Parallel from the Type options.

Using the State details panel:

  1. Select the parent state you want to set as the parallel state.
  2. Open the State details panel from the right tool menu.
  3. Choose Parallel from the Type dropdown menu.