zudo-doc
GitHub repository

Type to search...

to open search from anywhere

Mermaid Diagrams

Created Mar 14, 2026Updated Jun 16, 2026Takeshi Takatsudo

Mermaid diagram support for flowcharts, sequence diagrams, and more.

Use fenced code blocks with the mermaid language to render diagrams. Mermaid is loaded on-demand — pages without mermaid blocks incur no overhead.

Flowchart

graph LR A[Start] --> B{Decision} B -->|Yes| C[Action] B -->|No| D[Other Action] C --> E[End] D --> E
```mermaid

graph LR
  A[Start] --> B{Decision}
  B -->|Yes| C[Action]
  B -->|No| D[Other Action]
  C --> E[End]
  D --> E

```

Sequence Diagram

sequenceDiagram participant User participant App participant API User->>App: Click button App->>API: Fetch data API-->>App: JSON response App-->>User: Render result
```mermaid

sequenceDiagram
  participant User
  participant App
  participant API
  User->>App: Click button
  App->>API: Fetch data
  API-->>App: JSON response
  App-->>User: Render result

```

State Diagram

stateDiagram-v2 [*] --> Draft Draft --> Review : Submit Review --> Published : Approve Review --> Draft : Request Changes Published --> Archived : Archive Archived --> [*]
```mermaid

stateDiagram-v2
  [*] --> Draft
  Draft --> Review : Submit
  Review --> Published : Approve
  Review --> Draft : Request Changes
  Published --> Archived : Archive
  Archived --> [*]

```

Enlarge & Zoom/Pan

Every rendered diagram shows an enlarge button at its top-right corner — the same affordance used by Image Enlarge. Clicking it opens the diagram in a dialog with Google-Maps-style zoom and pan controls, so dense diagrams can be inspected up close.

The dialog has three controls:

  • + zooms in.

  • zooms out, but never below the dialog's original full-width size.

  • pan (hand) lets you drag the diagram around once it's zoomed in.

Their enable/disable behavior:

  • On open, the diagram is shown at full size. and pan are disabled — only + is clickable.

  • Clicking + zooms in and enables and pan.

  • With pan active, dragging pans the diagram.

  • Clicking zooms out; back at the original full width, and pan disable again.

Try it on the diagram below — click its enlarge button, zoom with +, then pan with the hand:

flowchart LR A[Author MDX] --> B[Build] B --> C[Render diagram] C --> D[Enlarge button] D --> E[Dialog: + / − / pan]

Configuration

Mermaid support is controlled by the mermaid setting in src/config/settings.ts:

export const settings = {
  // ...
  mermaid: true, // enabled by default
};

See the Mermaid documentation for all supported diagram types.

Revision History

Takeshi TakatsudoCreated: 2026-03-14T21:08:12+09:00Updated: 2026-06-16T20:52:15Z

AI Assistant

Ask a question about the documentation.