Interactive

Mermaid

A mermaid code block becomes a diagram that follows the colors of the theme.

Live demo

Click the deck, then use ← → · 2 slides · 00:00Open fullscreen →

Syntax

MarkdownMarkdown
```mermaid title="Lorem ipsum flow" graph LR A[Lorem] --> B[Ipsum] --> C[Dolor] ```
MDXMDX
<Mermaid title="Lorem ipsum flow" chart={`graph LR A --> B`} />
  • Rendered in the browser, and rendered again when switching between light and dark.
  • title becomes the accessible name; a diagram without a title triggers a diagnostic.
  • Mermaid is only bundled when a story uses it; mermaid.securityLevel defaults to strict.

Attributes and props

PropTypeDefaultDescription
chartstring—Diagram source (or children)
titlestring—Accessible name
captionstring—Text shown under the diagram
securityLevelstrict | loose | antiscriptstrictOnly in MDX. A :::component directive cannot set it: the level comes from mermaid.securityLevel of the configuration

In other formats

FormatStatusNotes
deckAvailableRendered in slides, the presenter console and the HTML and PDF exports.
docsAvailableThrough <StoryEmbed slug="…" /> in any page of a site.
motionAvailableAnimated block in a film.
reportPlanned · P6Section of a paged report.
toonPlanned · P7Panel of a vertical strip.
bookPlanned · P8Block of a printable chapter.
Last modified on