Writing Your First Mermaid Diagram
Mermaid.js lets you create diagrams using a simple and readable syntax. To write Mermaid diagrams, you use a code block that signals to Mermaid what kind of diagram you want to create. This code block starts with three backticks followed by the word mermaid. Everything you write inside this block will be interpreted as Mermaid syntax. The basic structure for a flowchart in Mermaid uses the flowchart keyword, followed by the direction of the flow, such as TD for top-down or LR for left-to-right. Inside the code block, you define nodes (steps or actions) and connect them with arrows to show the flow of your process.
index.html
Let's break down the flowchart syntax in the example above. The first line, flowchart TD, tells Mermaid to create a flowchart with a top-down layout. Each node is defined by a letter and a label in square brackets, such as A[Start]. Nodes are connected using arrows—-->—showing the direction from one step to the next. For decisions, curly braces are used for the label, like B{Is it sunny?}, and different outcomes are connected with labeled arrows, such as B -- Yes --> C[Go outside] and B -- No --> D[Stay inside]. All paths eventually lead to the final node E[Have fun!], demonstrating how to build a simple decision flow using Mermaid syntax.
Danke für Ihr Feedback!
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Can you show me a complete example of a Mermaid flowchart?
What other types of diagrams can I create with Mermaid?
Can you explain more about how to style or customize Mermaid diagrams?
Großartig!
Completion Rate verbessert auf 8.33
Writing Your First Mermaid Diagram
Swipe um das Menü anzuzeigen
Mermaid.js lets you create diagrams using a simple and readable syntax. To write Mermaid diagrams, you use a code block that signals to Mermaid what kind of diagram you want to create. This code block starts with three backticks followed by the word mermaid. Everything you write inside this block will be interpreted as Mermaid syntax. The basic structure for a flowchart in Mermaid uses the flowchart keyword, followed by the direction of the flow, such as TD for top-down or LR for left-to-right. Inside the code block, you define nodes (steps or actions) and connect them with arrows to show the flow of your process.
index.html
Let's break down the flowchart syntax in the example above. The first line, flowchart TD, tells Mermaid to create a flowchart with a top-down layout. Each node is defined by a letter and a label in square brackets, such as A[Start]. Nodes are connected using arrows—-->—showing the direction from one step to the next. For decisions, curly braces are used for the label, like B{Is it sunny?}, and different outcomes are connected with labeled arrows, such as B -- Yes --> C[Go outside] and B -- No --> D[Stay inside]. All paths eventually lead to the final node E[Have fun!], demonstrating how to build a simple decision flow using Mermaid syntax.
Danke für Ihr Feedback!