Skip to main content

Mermaid diagrams

Mermaid diagrams in your Markdown notes

Write a diagram as text and Koru draws it right in the note: flowcharts, sequence diagrams and pie charts, in your page's colors, on your own computer, with no internet needed. The text stays the source, so the diagram is easy to change, copy and export as Markdown.

Diagrams you write as text

Mermaid is a plain-text language for diagrams: a few lines describe the boxes and arrows, and a program draws them. In Koru, a code block whose language is Mermaid is drawn in place of its text, in the page's own colors and font, in light and dark themes.

There are several ways to start one:

  • Type /diagram or /mermaid in a document.
  • Choose Diagram from a row's +, which starts from a small three-box example.
  • Type three backticks and mermaid, then press Enter or Space.
  • Paste Markdown that holds a Mermaid block, or switch a code block's language chip to Mermaid.
  • Let an AI agent write one for you over MCP.

From text to diagram

This short block is a complete Mermaid flowchart. Under it is the diagram Koru draws from it.

mermaid
flowchart LR
    A[Write the text] --> B[Koru draws it]
    B --> C[Save as PNG or SVG]
Flowchart drawn by Koru: three boxes joined by arrows, from Write the text to Koru draws it to Save as PNG or SVG

Which Mermaid diagrams Koru draws

Koru draws three kinds of Mermaid diagram:

  • Flowcharts: flowchart or graph, in any direction, with subgraph groups.
  • Sequence diagrams: participants and actors, every arrow style, notes, activations, and loop, alt and opt frames.
  • Pie charts: a title, a percentage on each slice, a legend, and showData for the values.

Other Mermaid kinds keep their text, with a note that Koru does not draw that kind of diagram yet. Styling lines such as classDef and style are kept as written, and the theme decides the look.

Editing that keeps up

Click a diagram to select it, then press Enter or the pencil to edit its text. The text opens above the drawing, which redraws as you type, and Esc closes it again.

If a line cannot be read, Koru names it, for example "Line 7: this line could not be read", and keeps the last good drawing, labeled, until you fix it. Open shows a diagram full-window, where you can zoom in on the details.

Screen readers hear each diagram described: its kind, how many parts it has, and every arrow or message.

Markdown diagrams that stay on your computer

Koru draws diagrams natively on your device, with no browser, web view or JavaScript, so they work offline. The text is the source of truth: the drawing is never stored or synced, and each device draws its own.

Your notes live in a local database on your own devices. When they sync, only the text travels, peer-to-peer and end-to-end encrypted between your devices. Koru is a native app for Windows, macOS (12 or later, on Apple silicon) and Linux.

Copy as an image, save as PNG or SVG

Each diagram has a small bar in its corner with Open, Copy image, Save as and Edit text.

  • Copy image puts a picture at twice screen size on the clipboard, ready for slides or chat.
  • Save as writes a PNG at twice screen size, or an SVG that needs no fonts installed.
  • Copy the block itself and it pastes as a diagram in Koru, and as a fenced mermaid block in other apps.
  • Markdown export keeps each diagram as its Mermaid text, in a fenced code block.

Works with the AI you choose

Claude, Claude Code or any other MCP client connected to Koru's local MCP server can write Mermaid diagrams into your notes. Every time the agent reads a diagram back, Koru tells it whether the diagram drew and, if not, why, so it can check its own work.

Ask it to sketch how a process flows, or the sequence of an API call, and it lands as a real diagram you can edit.

What does Koru cost?

Koru is free, and so is peer-to-peer sync between your devices. Koru Cloud is optional at $9.99/month for 100 GB.

Questions

Which Mermaid diagrams does Koru draw?

Flowcharts, sequence diagrams and pie charts. Other Mermaid kinds stay as text in the note, with a note that Koru doesn't draw them yet.

Do Mermaid diagrams work offline in Koru?

Yes. Koru draws them on your own computer, with no browser, web view or internet connection.

Can I export a Mermaid diagram as PNG or SVG?

Yes. Choose Save as in the diagram's corner bar for a PNG or an SVG, or use Copy image to paste a picture into slides or chat.

Can Claude write Mermaid diagrams into my notes?

Yes. Connect Claude, Claude Code or another MCP client to Koru's local MCP server and it can add Mermaid diagrams to your notes and check that they drew. Koru works with the AI you choose.

What happens to Mermaid in Markdown I import or paste?

A Mermaid code block in imported or pasted Markdown, including a page pasted from Notion, becomes a diagram in Koru, and exports back to Markdown as the same text.

Last updated

Privacy choices

Choose which optional tools Koru may use on this site. Your choice is saved in a cookie in this browser for 12 months. Privacy policy

Privacy choices

Keep you signed in, protect forms and remember your language and this choice.

Always on

PostHog and Google Analytics 4 measure page views and actions such as downloads, using cookies or local storage.

PostHog records how pages are used, with form inputs masked and private pages excluded. Needs Analytics.

Ahrefs Web Analytics measures visits and where they come from, and Google Ads measures whether our ads led to a visit or download.