Mermaid lets you create diagrams using text-based syntax.

Use triple backticks and the mermaid keyword to render diagrams in Obsidian:


  

graph TD

  

A --> B

  


āž¤ Flowcharts


  

graph TD

  

A[Start] --> B{Is it working?}

  

B -- Yes --> C[Great!]

  

B -- No --> D[Fix it]

  

D --> B

  

Basic Structure


  

graph TD

  

A[Start] --> B{Is it working?}

  

B -- Yes --> C[Great!]

  

B -- No --> D[Fix it]

  

D --> B

  

  • graph TD = Top-down

  • graph LR = Left-to-right


Node Shapes


  

graph LR

  

A[Rectangle]

  

B(Rounded)

  

C{Diamond}

  

D((Circle))

  

E[[Subroutine]]

  

F[/Parallelogram/]

  

G[\Input/]

  

H{{Database}}

  


Arrow Types


  

graph LR

  

A --> B

  

A --- C

  

A -.-> D

  

A ==> E

  

A -->|Label| F

  


Subgraphs


  

graph TD

  

subgraph Group 1

  

A1 --> A2

  

end

  

subgraph Group 2

  

B1 --> B2

  

end

  

A2 --> B1

  


šŸ‘„ Sequence Diagram


  

sequenceDiagram

  

participant Alice

  

participant Bob

  

Alice->>Bob: Hello Bob, how are you?

  

Bob-->>Alice: I'm good, thanks!

  


šŸ” State Diagram


  

stateDiagram-v2

  

[*] --> Idle

  

Idle --> Working : start()

  

Working --> Completed : finish()

  

Completed --> [*]

  


šŸ“Š Gantt Chart


  

gantt

  

title Project Timeline

  

dateFormat YYYY-MM-DD

  

section Planning

  

Requirements :a1, 2025-04-01, 3d

  

Design :after a1, 5d

  

section Development

  

Coding :2025-04-10, 10d

  

Testing :5d

  


🧠 Mindmap


  

mindmap

  

Root

  

🌿 Branch A

  

šŸƒ Leaf A1

  

šŸƒ Leaf A2

  

🌿 Branch B

  

šŸƒ Leaf B1

  


šŸ—ļø Class Diagram


  

classDiagram

  

class Animal {

  

+String name

  

+eat()

  

}

  

class Dog {

  

+bark()

  

}

  

Animal <|-- Dog

  


šŸ”— Entity Relationship Diagram (ERD)


  

erDiagram

  

CUSTOMER ||--o{ ORDER : places

  

ORDER ||--|{ LINE_ITEM : contains

  

CUSTOMER {

  

string name

  

string email

  

}

  

ORDER {

  

int id

  

date orderDate

  

}

  


🄧 Pie Chart


  

pie

  

title Storage Breakdown

  

"Apps" : 40

  

"Media" : 25

  

"System" : 20

  

"Other" : 15

  


🧩 Callouts (Not Mermaid, but useful in Obsidian)

 
  
 
> [!note] Note Title
> 
 
  
 
> This is a note callout.
 
  
 

Types: note, info, tip, warning, danger, example, quote


🧰 Obsidian Tips

  • Use Live Preview or Reading View to see Mermaid diagrams.

  • Works out of the box — no plugin required.

  • For advanced styling, use custom CSS snippets or the Mermaid Plugin.


šŸ“š Resources