graph: creates a flowchartsequence: creates a sequence diagramgantt: creates a Gantt chartclass: creates a class diagrampie: creates a pie chart
-->: creates a directed edge---: creates an undirected edge=>: creates a directed link==>: creates a directed solid link---|: creates a right angle link--x|: creates a right angle link with a cross--o|: creates a right angle link with a circle-->|: creates a right angle link with an arrowhead--*|: creates a right angle link with an asterisk==>|: creates a solid right angle link with an arrowhead==*|: creates a solid right angle link with an asterisk->>: creates a message arrowalt: creates an alternative conditionopt: creates an optional conditionloop: creates a loop conditionpar: creates a parallel conditionnote: creates a note
rect: creates a rectangleroundRect: creates a rounded rectanglecircle: creates a circleellipse: creates an ellipsestadium: creates a stadium shapeparallelogram: creates a parallelogramtrapezoid: creates a trapezoiddiamond: creates a diamondhexagon: creates a hexagonbox: creates a box
Here are a few examples of Mermaid diagrams in Markdown using the above syntax:
graph LR
A --> B
B --> C
C --> D`
sequenceDiagram
participant A
participant B
A->>B: Message 1
B->>A: Message 2
gantt
dateFormat YYYY-MM-DD
title Example Gantt Chart
section Section 1
Task 1 :a1, 2014-01-01, 30d
Task 2 :after a1, 20d
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
pie
title Browser market share
"Chrome" : 64
"Firefox" : 16
"IE" : 10
"Other" : 10