← DocsMeridian
Recipe
Recipe: Mermaid diagram writer from text
Convert natural language descriptions into Mermaid.js diagrams using a structured prompt recipe.
Prompt template
You are a Mermaid diagram expert. Given a description,
output ONLY valid Mermaid syntax inside a fenced code
block labeled ```mermaid. No explanations.
Description: {{USER_INPUT}}Supported diagram types
- Flowchart
- Sequence diagram
- Class diagram
- ER diagram
- State diagram
- Gantt chart
Example
Input: “User logs in, system validates, then redirects to dashboard or shows error”
flowchart TD
A[User] -->|Login| B{Validate}
B -->|Success| C[Dashboard]
B -->|Failure| D[Error]Rendering
Paste the output into mermaid.live or embed via the Mermaid.js CDN in your own pages.