Quickly learn how to create various diagrams using Mermaid syntax
graph TD
A[π Start Project] --> B{π Have Requirements?}
B -->|β
Yes| C[π» Start Coding]
B -->|β No| D[π Gather Requirements]
D --> B
C --> E{π§ͺ Tests Pass?}
E -->|β
Yes| F[π Deploy!]
E -->|β No| G[π§ Fix Bugs]
G --> EBasic Syntax:
graph TD defines a top-down flowchart A[Text] creates a rectangle node B{Text} creates a diamond node (typically for conditions) --> creates a connection between nodes -->|Text| creates a labeled arrowsequenceDiagram participant U as π€ User participant S as π₯οΈ System participant D as πΎ Database U->>S: π Submit Request S->>D: π Query Data D-->>S: π Return Results S-->>U: β Display Response
Basic Syntax:
sequenceDiagram defines a sequence diagram participant Name defines a participant A->>B: Text creates a solid arrow (synchronous message) A-->>B: Text creates a dashed arrow (asynchronous message)classDiagram
class Animal {
+String name
+int age
+makeSound()
}
class Dog {
+String breed
+bark()
+fetch()
}
class Cat {
+String color
+meow()
+sleep()
}
Animal <|-- Dog
Animal <|-- CatBasic Syntax:
classDiagram defines a class diagram class ClassName {} defines a class with properties/methods + indicates public properties/methods - indicates private properties/methods A <|-- B indicates B inherits from A (B is a subclass of A)stateDiagram-v2 [*] --> Idle Idle --> Processing: Start Task Processing --> Success: Complete Processing --> Error: Failed Error --> Processing: Retry Success --> [*]
Basic Syntax:
stateDiagram-v2 defines a state diagram [*] represents start or end state A --> B represents a transition from state A to B A --> B: Text adds transition description texterDiagram
USER ||--o{ ORDER : places
ORDER ||--|{ ITEM : contains
USER ||--o{ REVIEW : writes
ITEM ||--o{ REVIEW : receivesBasic Syntax:
erDiagram defines an entity relationship diagram ||--o{ represents a one-to-many relationship ||--|{ represents a one-to-many (mandatory) relationship }|..|{ represents a many-to-many relationship (dashed line) : Text adds relationship labelgantt title π Project Timeline dateFormat YYYY-MM-DD section Planning Requirements :done, req, 2024-01-01, 7d Design :active, des, after req, 10d section Development Coding :dev, after des, 14d Testing :test, after dev, 7d section Launch Deploy :deploy, after test, 3d
Basic Syntax:
gantt defines a Gantt chart title Title sets the chart title dateFormat Format sets the date format section Name creates a task section Task Name: ID, Start Date, Duration/End Date defines a task with its timespan done/active marks task status (completed/in progress) after ID defines task dependencypie title π Time Distribution "π» Coding" : 40 "π Debugging" : 25 "π Learning" : 20 "β Coffee Break" : 15
Basic Syntax:
pie defines a pie chart title Title sets the chart title "Label" : Value defines a slice in the pie chartThis page provides basic Mermaid syntax guidelines. For more advanced features and detailed syntax, please refer to: