Diagrams: Mermaid, TLDraw, Excalidraw

Why it matters

Documentation without diagrams is boring and hard to follow. System
architecture, data flow, a user journey — a single picture explains
it faster than ten paragraphs of text.

Nextdocs gives you three different ways to draw. All of them live
directly in the page — no external tools, external files, or
screenshots needed.

Which tool for which case

Tool

Input

Good for

Not good for

Mermaid

Text DSL

Flow charts, sequence diagrams, ER, Gantts, state machines — when structure matters more than aesthetics

Free-form drawing, arbitrary shapes

TLDraw

Mouse / trackpad

Architecture schemes, wireframes, UI mockups — geometrically precise diagrams

Text-DSL diagrams (flowchart etc.)

Excalidraw

Mouse / trackpad

Sketches, whiteboard notes, doodles — hand-drawn feel

Precise technical schemes (looks "handwritten")

Rule of thumb: if you want a diagram editable in a PR review — pick
Mermaid (it shows up in git diff). If you want to quickly throw an
"idea on a napkin" — Excalidraw. If you need a precise scheme with
alignment and snapping — TLDraw.

Mermaid

How to insert

  1. Pick Code in the slash menu.

  2. In the top-right corner of the block — a language dropdown. Pick
    mermaid.

  3. Enter the diagram code:

flowchart LR
    A[Start] --> B{Is user authed?}
    B -->|Yes| C[Load page]
    B -->|No| D[Redirect to login]

A picture renders right below the block. Edit the code — the picture
re-renders in real time.

What Mermaid can do

Full grammar — https://mermaid.js.org.

Tips

Collaboration

While editing a Mermaid block, colleagues see your cursor (in the
code, not on the SVG). The picture re-renders for everyone
automatically.

TLDraw

How to insert

  1. Slash menu — Diagram.

  2. A built-in canvas about 400 pixels tall appears.

  3. Draw: pick a tool on the left (rectangle, ellipse, arrow, text),
    click-drag across the canvas.

  4. For full-featured work — click the "expand" icon in the top-right.
    The canvas opens in full-window mode.

What TLDraw can do

Collaboration

Real-time: colleagues' cursors are visible, all changes apply
synchronously. Two people can drag different shapes at the same time
— no conflicts.

Excalidraw

How to insert

  1. Slash menu — Excalidraw.

  2. Same flow — built-in canvas, fullscreen via the icon.

Difference from TLDraw

Excalidraw is better for communicating ideas "in conversation":
"Look, this is frontend, this is backend, the arrow is a request".
For strict documentation that needs to last years — TLDraw or
Mermaid are preferable.

Collaboration

Also real-time, including live cursors.

Search across diagrams

The internal Nextdocs search indexes text inside diagrams:

So if you labelled a rectangle "Auth Service", global search
(Cmd/Ctrl+K) finds this diagram with the query "Auth".

Google search on public docs doesn't index diagrams as images
only surrounding text and captions.

Fullscreen mode

The "expand" icon (top-right of any diagram) blows the editor up to
the full viewport. ESC or another click to exit.

Fullscreen is comfortable for big diagrams; in-page is fast for a
quick look + minor tweak.

Limitations