Skip to content
Lower pricing Individual licenses are now $49/year for Studio, $25 for Core — See pricing →

State Diagram

Last updated:

Mermaid Studio provides full language support for State diagrams inside IntelliJ-based IDEs. State diagrams visualize the states an entity can be in and the transitions between those states, and are invaluable for modeling workflows, user interfaces, protocol behavior, and any system with distinct operational modes.

Syntax highlighting integrates directly with IntelliJ’s color scheme system, so diagram colors always match your editor theme.

State diagram syntax highlighting in Armada Dark theme

The summary below shows the IDE support Mermaid Studio ships for state diagrams, grouped by capability.

IDE feature supportSelect a feature for its description.
Editing
Code Intelligence
Validation
Refactoring
Preview
Visual Editing

Rename updates state names everywhere they appear, including comma-separated class A,B,C styleName targets. Parse errors inside a composite state stay contained in that body, so sibling states and transitions keep their highlighting and validation.

A set of 13 context-aware live templates scaffolds state declarations, transitions, and notes. Type a short abbreviation, accept it from the completion popup, and tab through the template variables.

Individual abbreviations can be toggled under Settings > Tools > Mermaid Studio > Live Templates in the State Diagram group. See Live Templates for the cross-cutting mechanics (triggering, contextual visibility, configuration).

AbbreviationExpansion
saAliased state with description (state "..." as Name)
scComposite state with body
schChoice pseudo-state (state Name <<choice>>)
sfFork pseudo-state (state Name <<fork>>)
sjJoin pseudo-state (state Name <<join>>)
AbbreviationExpansion
trTransition (From --> To)
trlTransition with label (From --> To : event)
trsTransition from start ([*] --> To)
treTransition to end (From --> [*])
AbbreviationExpansion
nlNote left of state (inline form)
nrNote right of state (inline form)
nlmNote left of state (multi-line form)
nrmNote right of state (multi-line form)
stateDiagram-v2
[*] --> Active
state Active {
[*] --> Working
Working --> Waiting : pause
Waiting --> Working : resume
}
Active --> Inactive : disable
Inactive --> Active : enable
Inactive --> [*]
note right of Active : Main operational state

Key elements:

  • [*] - Initial and final states
  • state1 --> state2 - Transition between states
  • state1 --> state2 : event - Transition with event label
  • state Name { } - Composite (nested) state
  • note - Add notes to states

For complete syntax details, see the Mermaid State Diagram documentation.