Catch broken connectors and misaligned boxes as you edit
Autocheck checks a Mermaid diagram half a second after you stop editing. It flags connections that don't reach their boxes, nodes named only in a connection, overlapping labels, and boxes a few pixels out of line, and it can fix some of them.
A diagram can be valid Mermaid and still look wrong. An arrow stops short of its box, a typo in an id creates an extra node, a label hides behind a box, or two boxes in Manual mode sit 3 pixels apart from a straight row. Autocheck looks for these while you work, so you see them before anyone else does.
Plan: Free, Pro and Pro Max. Autocheck is on by default; turn it off for your account or for one project.
What it checks
Autocheck runs the same rules as Check diagram (the clipboard in the top bar), half a second after you stop typing or dragging. It works on flowcharts, state diagrams, ER diagrams, and class diagrams, and it measures the drawing on the canvas as well as the code.
- Errors are drawings that are plainly broken: a connection whose end stops more than a few pixels from its box, or a connection to something that isn't in the diagram.
- Warnings are likely mistakes: a node only named in a connection, a connection that runs through another box, labels that overlap each other or a box, boxes that overlap, text that doesn't fit, low contrast, and, in Manual mode, boxes nearly but not exactly in a row or column.
- Suggestions are about style: long labels, ids shown as labels, the same connection written twice.
A typo is the most common cause of a node without a definition. In this diagram chek was meant to be check, so Mermaid quietly draws a fourth box:
flowchart LR
order[Order placed] --> check{In stock?}
check -->|yes| ship[Ship it]
check -->|no| wait[Wait for stock]
wait --> chekAutocheck flags chek as never defined and asks whether you meant check.
The badge
A small badge sits beside the zoom controls. A red cross with a number counts errors, and an amber triangle counts warnings. A green tick means there's nothing to flag. Suggestions aren't counted, so the badge stays quiet about matters of taste.
Click the badge to open the list. Click a finding to outline its boxes and connections on the canvas. Where a fix is safe, the finding offers one:
- Line up the row (or column) moves the boxes that are off so their centres match the one most of them share.
- Reattach automatically forgets the sides a connection was attached to by hand.
- Put the label back returns a moved label to its connection.
Each fix shows the lines it changes before you apply it, and Undo reverses it in one step. Dismiss hides a finding you meant, such as a legend that isn't connected to anything. Dismissals are saved in a comment line in the code, so they travel with the diagram.
Turning it off
Autocheck is on by default, on every plan.
- For one project: open the project, then choose Autocheck for this project in its … menu. You can also use the switch at the foot of the Check diagram panel.
- For your account: turn it off in Account settings, under Editor. Off for the account means off in every project, whatever each project says.
- Signed out: the switch in the Check diagram panel keeps the setting in this browser.
Check diagram still works when Autocheck is off; it runs when you open it.
Limits
The checks look at how a diagram reads, not at whether the design is right. A clean result doesn't mean the diagram is correct, secure, or complete. Sequence diagrams and the other Mermaid types aren't checked yet.
More guides
- Edit Mermaid diagrams visually in VS CodeDrag, connect and restyle a Mermaid diagram on Flowgraph's canvas inside VS Code, and every change is written back into the .mmd file or Markdown block as ordinary code.
- Keep a diagram's style in its code with %% flowgraph-themeOne comment line keeps a Mermaid diagram's Flowgraph theme in the file, so it looks the same in your repository, in VS Code, from the CLI and through the render API.
- Preview Flowgraph diagrams in VS Code, with icons, layout and your themeInstall the Flowgraph Studio extension to preview Mermaid files and Markdown blocks in VS Code as Flowgraph draws them, see mistakes in plain words, and export SVG or PNG.