Canvas and blocks
Add steps, connect them with arrows, group them, color them and fix mistakes with undo.
The canvas is the big open area where you draw. Everything you draw here becomes Mermaid code at the same time.
Move around
- Drag empty canvas to move the view.
- Scroll the mouse wheel to zoom. Zoom stays between 20% and 300%.
- On a touch screen, pinch with two fingers to zoom.
- Use the zoom buttons (minus and plus) and the Center view button at the top right. On a narrow screen they are in the "⋯" menu. More in Camera moves.
Add steps
Pick a block in the dock at the bottom (on a phone: Add in the bottom bar). The new block appears just below the step you have selected. With nothing selected, it goes below your newest step, or to the middle of the view on an empty canvas. Start always goes to the middle of the view.
You can also right-click an empty spot on the canvas (or press and hold on a touch screen) and choose Add ... here to place a block exactly there.
Block types
There are ten blocks. Each one has its own shape and exports as its own Mermaid shape.
| Block | Use it for |
|---|---|
| Step | A normal action |
| Decision | A yes/no question |
| Start | Where the flow begins |
| End | Where the flow ends |
| Data | Something going in or out: a form, a file, an email |
| Subprocess | A step that is a whole process of its own |
| Database | A database or CRM |
| Document | A document or report |
| Connector | A small circle that joins far-apart arrows |
| Note | A note next to a step |
To change a block later, right-click it and choose Change type....
Rename
Double-click a step, or select it and press F2. Type and press Enter. Esc cancels. A counter under the step shows the length. The limit is 60 characters. Text pasted beyond the limit is cut.
Groups are renamed by double-clicking their header bar.
Connect steps
There are two ways.
- Drag from a dot. Point at a step. Connection dots appear around it. Drag from a dot onto another step. If you drop close to a step, it still connects.
- Use the + button. Select the "+" on any of the four sides of a step. A new step appears on that side, already connected. A step added on the left or above comes before the current one. Press and hold the "+" to choose which block type to add.
A Decision works differently: from any of its four sides, "+" or a drag from a dot always makes the arrow leave the Decision and point to the new or target block.
How arrows are drawn (straight, curved or angled) is one setting for the whole project. See line style.
Loop-backs (an arrow going back to an earlier step) and an arrow from a step to itself both work.
Label an arrow
Double-click an arrow, or select it and press F2. Type the label and press Enter. After you draw an arrow out of a Decision, its label field opens by itself so you can type "Yes" or "No". Arrow labels may be left empty.
To delete an arrow, select it and press Delete. On touch screens a red "x" button appears on a selected arrow.
Groups
A group is a frame around several steps. Groups can sit inside other groups.
- Select the steps.
- Select Group in the Arrange tools of the dock. With nothing selected, it adds an empty group in the middle of the view.
- Rename it by double-clicking its header. Drag the corner to resize it.
If one group and some other steps are selected, the button says Add to group and puts them inside. To take steps out, select them and use Detach. To remove a group but keep its steps, select the group and use Ungroup.
Colors
Select a step or group. A color bar appears under it. It has six presets (blue, green, yellow, red, purple, gray), a "No color" swatch and a custom color button. For a custom color, pick one or type a HEX code such as #fff000, then select Apply. Arrows cannot be colored.
You can also right-click and choose Change color....
Select several items
- Select the Select tool, then drag a rectangle or tap items to add and remove them. This works well with a finger.
- Or hold Shift and drag on empty canvas.
- Hold Shift, Cmd or Ctrl while clicking to add one item to the selection.
You can then move, color, group or delete them together.
Right-click menu
Right-click an item (or press and hold on touch) for its menu. For a step it includes Add connected step, Rename, Add attachment, Change color..., Change type..., Duplicate (empty), Duplicate with content and Delete. Press Ctrl+D or Cmd+D to duplicate with content.
Undo and redo
Use the undo and redo buttons at the top right, or press Cmd+Z / Ctrl+Z, and Shift+Cmd+Z / Shift+Ctrl+Z. The editor remembers the last 100 steps.
To delete the selected items, press Delete or Backspace, or use Delete in the Arrange tools.
Text size
To make the interface text bigger, open the theme menu at the top right (on a narrow screen it is in the "⋯" menu, as Theme and text size…). Under Text size, choose Default, +1 or +2. This is remembered on your device.
Limits
- Names are limited to 60 characters.
- Undo goes back 100 steps.
- Flowcharts only.