Mermaid
Use Mermaid diagrams for small flows, system relationships, and decision paths.
Mermaid is useful when a flow is clearer as a diagram than a list. Keep diagrams short enough to scan.
Basic example
<Mermaid title="Checkout flow">
```mermaid title="checkout-flow.mmd"
flowchart LR
A[Published offer] --> B[Checkout session]
B --> C[Payment]
C --> D[Automation]
```
</Mermaid>
Decision diagram
Use Mermaid when a reader needs to understand branching behavior. For purely linear setup, use Steps instead.
<Mermaid title="Which component should I use?" actions placement="top-right">
```mermaid title="component-choice.mmd"
flowchart TD
A[Does the reader need to act?] -->|Yes| B[Steps]
A -->|No| C[Is this a choice?]
C -->|Implementation option| D[Tabs or CodeGroup]
C -->|Optional detail| E[Accordion or Expandable]
C -->|API shape| F[Fields and Examples]
```
</Mermaid>
Sequence diagram
Sequence diagrams work well for API, SDK, webhook, and automation handoffs because each participant stays visible.
<Mermaid title="Checkout session handoff" actions={false}>
```mermaid title="checkout-session-sequence.mmd"
sequenceDiagram
participant Site
participant Plandalf
participant Stripe
participant Automation
Site->>Plandalf: Create checkout session
Plandalf->>Stripe: Prepare payment
Stripe-->>Plandalf: Payment result
Plandalf->>Automation: Purchase event
```
</Mermaid>
Authoring rules
Mermaid usage
Use for relationshipsflow, sequence, decisionUse diagrams for relationships that become harder to follow as prose or bullets.
Keep it smallscan firstA docs diagram should usually fit in one viewport. Split dense architecture into multiple focused diagrams.
Prefer plain labelsreadable nodesUse short labels and avoid visual decoration inside Mermaid source. Let the docs theme handle styling.
Normalize pasted sourcetypographic arrowsThe renderer normalizes typographic arrows and quotes, but authors should still commit normal Mermaid syntax.
Properties
actionsboolean | autodefault: autoShow or hide the interactive zoom and pan controls. auto shows controls when the rendered diagram is tall enough to need them.
placementtop-left | top-right | bottom-left | bottom-rightdefault: bottom-rightPosition of the interactive controls.
Plandalf extensions
titlestringCaption shown above the rendered diagram.
class | classNamestringAdds a class to the figure for rare layout-specific cases.