mermaid diagrams

published: August 15, 2025

This site supports Mermaid diagrams for creating flowcharts, sequence diagrams, and other visualizations directly in your content.

Using Mermaid in MDX

You can use Mermaid diagrams in two ways:

Method 1: Markdown Code Blocks

Use standard markdown code blocks with the mermaid language identifier:

Rendering diagram...

Method 2: Component with Title and Description

Architecture Overview
Rendering diagram...

This diagram shows the system architecture with its main components

Examples

Flowchart

Rendering diagram...

Sequence Diagram

Rendering diagram...

Class Diagram

Rendering diagram...

State Diagram

Rendering diagram...

Entity Relationship Diagram

Rendering diagram...

Gantt Chart

Rendering diagram...

Pie Chart

Rendering diagram...

Git Graph

Rendering diagram...

While Mermaid supports a click syntax for adding links, it can be unreliable with this site’s configuration, causing rendering issues. The recommended and most stable method is to embed raw HTML <a> tags directly within the node labels.

Rendering diagram...

Features

The Mermaid integration includes:

  • Theme Support: Diagrams automatically adapt to light/dark mode
  • Copy Code: Copy the Mermaid code to clipboard
  • Export SVG: Download diagrams as SVG files
  • Export PNG: Download diagrams as PNG images
  • Fullscreen View: View complex diagrams in fullscreen mode
  • Error Handling: Graceful fallback for invalid diagrams

Tips

  1. Keep diagrams simple: Complex diagrams can be hard to read on mobile devices
  2. Use descriptive labels: Clear labels make diagrams more understandable
  3. Test rendering: Preview your diagrams to ensure they render correctly
  4. Consider accessibility: Add descriptions for screen readers when possible

Resources

on this page