Tesria

Diagram (Mermaid)

A diagram draws a flowchart, a sequence of messages, a timeline or another kind of chart from a few lines of text, using a popular free tool called Mermaid. You write what is connected to what, and the drawing follows.

Changing a diagram is as easy as editing a sentence: no boxes to drag, and no picture to make again in another program. The text lives in the page, so the next person can change it too.

Insert it

Type this

To get

/mermaid

A diagram, starting as a small flowchart

/diagram

The same

/flowchart

The same

/sequence

The same

Type the command and press Enter, or choose + on the toolbar, then Diagram (Mermaid). You get a small example flowchart to change. If text is selected, the diagram takes its place.

A diagram is a code block whose language is Mermaid diagram, so you can also make one from any Code block by choosing Mermaid diagram in its language menu, or by typing ```mermaid at the start of a line and pressing Enter.

To change the text, choose Source at the top right of the diagram; choose Diagram to see the drawing again.

Kinds of diagram, and when to use each

The first word of the text says what kind of diagram it is. Here are the most useful kinds, each drawn live from its text. Choose Source on any of them to see how it is written, and copy it as a start for your own.

Flowchart

Mermaid diagram

No

Yes

Expense to claim

More than 500?

Submit it in the expenses app

Ask your manager to approve it

Paid with your next salary

Steps and choices: a process, an approval path, what to do when something breaks. flowchart TD draws it top to bottom; flowchart LR, left to right.

Sequence diagram

Mermaid diagram
Payment providerShopCustomerPayment providerShopCustomerPlace orderCharge cardPayment approvedConfirmation email

Who sends what to whom, in order: how two systems talk to each other, or the hand-offs between teams.

State diagram

Mermaid diagram

Submit

Changes requested

Approve

In review

Draft

Approved

The stages something moves through, and what moves it on: a document’s review, an order, a support request.

Gantt chart

Mermaid diagram
2026-10-012026-10-032026-10-052026-10-072026-10-092026-10-112026-10-132026-10-152026-10-172026-10-192026-10-212026-10-232026-10-252026-10-272026-10-292026-10-312026-11-01Choose furniture Order furniture Pack Move day PlanningMovingOffice move

A plan over time, with each task a bar on a calendar and what has to wait for what.

Timeline

Mermaid diagram
2024Version 12025Shared foldersFaster first sync2026Version 2, withoffline editingKestrel Sync releases

Events in order, such as a project’s history or a product’s releases, without the detail of a Gantt chart.

Pie chart

Mermaid diagram
42%28%18%12%Support requests by topicSigning inBillingExportsOther

Shares of a whole, for a quick impression. When readers need the exact numbers, a table with a Chart drawn from it serves them better.

Mind map

Mermaid diagram

Launch

Marketing

Blog post

Newsletter

Support

Help pages

Training

Sales

Price list

Ideas branching out from one topic: a brainstorm, or the parts of a project at a glance. Indentation sets what belongs to what.

User journey

Mermaid diagram
ITNew starter
First day
First day
New starterIT
Collect laptop
Collect laptop
New starter
Meet the team
Meet the team
Rest of the week
Rest of the week
New starterIT
Set up accounts
Set up accounts
New starter
First project
First project
A new starter’s first week

How an experience feels, step by step, each step scored from 1 (bad) to 5 (good) and with the people involved: onboarding, a customer’s first order.

Quadrant chart

Mermaid diagram
Plan carefullyDo firstMaybe laterSkipCustom fontsNew iconsOffline modeDark themeLow effortHigh effortLow impactHigh impactIdeas by effort and impact

Things placed on two scales at once, such as ideas by effort and impact, to decide what to do first.

Entity relationship diagram

Mermaid diagram

places

contains

appears in

CUSTOMER

ORDER

ORDER_LINE

PRODUCT

How the tables in a database relate to each other: which one holds many of which. For developers and data teams.

Class diagram

Mermaid diagram

places

1

*

Customer

name

email

placeOrder()

Order

date

total()

The parts of a program and how they connect, with what each one holds and does. For developers.

Git graph

Mermaid diagram
mainfeature0-f5fa60d1-ed9f7a82-9ac121c4-b4d7fd4

Branches and merges in a code repository, to explain how a team works with Git.

And more

The Mermaid in this version of Tesria also draws XY charts, Sankey diagrams, Kanban boards, block diagrams, packet diagrams, requirement diagrams and C4 architecture diagrams, among others. Mermaid’s own documentation, at mermaid.js.org, shows how to write every kind.

Changing and removing a diagram

  • Source and Diagram, at the top right, switch between the text and the drawing. While you edit, change the text in Source, then choose Diagram to check the result. Readers can open Source too, to see how it is made.

  • Copy copies the text.

  • The language menu, at the left while you edit: choose another language and the diagram becomes an ordinary code block showing its text.

A mistake in the text shows Mermaid’s own message where the drawing would be, usually naming the line that went wrong. Diagrams are drawn in light or dark colors to match the theme Tesria is in.

Good practice

  • Start from an example and change one line at a time, checking with Diagram as you go.

  • Keep it small. Ten or fifteen boxes are about as many as a reader can follow; split a bigger diagram into several.

  • Label the arrows when the reason for a step is not obvious, as the Yes and No of the flowchart above.

  • Say in a sentence what the diagram shows. Not every reader can see it, and the sentence helps those who can.

  • Code block shows text as code rather than drawing it.

  • Chart draws the numbers in a table as bars, lines or a pie.

  • Image for a picture made in another program.


Applies to

Tesria 0.5 and later

Updated

September 24, 2026

Changes

Revised.