Adding notes and changing the direction of rendering
Sometimes it is useful to be able to add comments or some extra clarifications right into the state diagram. With Mermaid, you can do this by adding notes into your diagram and the notes are added as a block of text in a box anchored to a state. In this section, you will learn how to use this feature as well as changing the direction in which the nodes are positioned in the diagram. Let's start with how to add notes.
The syntax starts with the keyword note, a position and a state ID where the direction can be right of
or left of
. One thing to be aware of is that this direction depends on the current direction of the rendering in the state diagram, which means that left of
can also become above in practice, and right of
can similarly become below if the rendering direction is from right to left. We will return to the subject of rendering directions later in this section.
There are two ways to add notes into a state diagram...