---
title: "Mermaid diagrams"
description: "Draw a flowchart, sequence or other diagram from text."
---

Start a code block with `mermaid`, and write the diagram in [Mermaid](https://mermaid.js.org) syntax. Anything after the
word is the diagram's title.

```mermaid Publishing a page
flowchart LR
  A[Edit page] --> B[Push to GitHub]
  B --> C[Specly builds]
  C --> D[Site is live]
```

````mdx
```mermaid Publishing a page
flowchart 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.

## Props

A `mermaid` block becomes a `Mermaid` component with these props.

- `chart` (string): The diagram's source.

- `title` (string): A caption above the diagram.
