- Documentation
- Components
- Mermaid diagrams
Mermaid diagrams
Draw a flowchart, sequence or other diagram from text.
Start a code block with mermaid, and write the diagram in Mermaid syntax. Anything after the
word is the diagram’s title.
Diagram source
flowchart LR
A[Edit page] --> B[Push to GitHub]
B --> C[Specly builds]
C --> D[Site is live]```mermaid Publishing a pageflowchart LR A[Edit page] --> B[Push to GitHub] B --> C[Specly builds] C --> D[Site is live]```The diagram is drawn in the reader’s browser, using their theme’s colors, when it scrolls near the screen. Its source sits under it in a Diagram source disclosure, so screen readers and search read the text. If Mermaid can’t read the source, the source opens in place of the drawing.
Diagrams are drawn in .mdx pages. In a .md page, the source shows and the build warns.
A mermaid block becomes a Mermaid component with these props.
chartstring- The diagram’s source.
titlestring- A caption above the diagram.