Flowchart
Flowcharts are the most versatile diagram type in Mermaid, perfect for visualizing processes, decision trees, and system workflows. Mermaid Studio provides the most comprehensive support for flowcharts.
Basic Example
Section titled “Basic Example”flowchart TD Start([Start]) --> Input[/Get Data/] Input --> Process[Process Data] Process --> Decision{Valid?} Decision -->|Yes| Output[Display Results] Decision -->|No| Error[Show Error] Output --> End([End]) Error --> EndWhat You Get
Section titled “What You Get”Flowcharts have the most complete feature set in Mermaid Studio:
- Syntax highlighting - Color-coded keywords, nodes, and edges
- Code completion - Suggestions for node shapes, arrow types, and keywords
- Refactoring - Rename node IDs across your entire diagram
- Find usages - See everywhere a node is referenced
- Code folding - Collapse subgraphs in large diagrams
- Formatting - Auto-format your diagram code
- Inspections - Detect undefined nodes and duplicate IDs
- Brace matching - Navigate between paired brackets
- Color preview - See hex colors inline in style definitions
Quick Syntax Reference
Section titled “Quick Syntax Reference”Directions:
TDorTB- Top to bottomLR- Left to rightRL- Right to leftBT- Bottom to top
Node shapes:
[Text]- Rectangle([Text])- Stadium/pill{Text}- Diamond (decision)[/Text/]- Parallelogram (input/output)((Text))- Circle
Edges:
-->- Arrow---- Line-.->- Dotted arrow==>- Thick arrow-->|Label|- Arrow with text
Subgraphs:
flowchart LR subgraph Backend API --> DB end subgraph Frontend UI --> API endFor the complete syntax reference, see the Mermaid.js Flowchart documentation.