Diagrams

A mermaid code fence renders as a diagram on every sink, painted by the material tokens so it follows the color scheme: a picture on the web, box-drawing text or a kitty raster on the terminal.

Flowchart

ParsewebterminalMarkdownEntity treeSink?Inline svgBox art

Sequence

parse, style,renderGET/docs/design/diagramstext/htmlBrowserServerBrowserServer

Class

buildsDiagramFormSvgTextRasterMermaidDiagram+String source+DiagramKind kind

State

webterminalgraphicslost graphicsCollectedRasterSvgText

Entity relationship

servesrendersreadsPAGEROUTEROUTERSTORE

Pie

55%30%15%MarkupStylesheetScriptWhere a page's bytes go

Gantt

A release2026-09-012026-09-032026-09-052026-09-062026-09-08BuildShipCompileTestDeployAnnounce

Git graph

mainfeature0-0ba4dfe1-47bae982-8d8b4d54-b12c530

Text form

The info word after the language pins one fence, here to the box-drawing form on every sink:

┌────────┐     ┌────────┐     ┌──────┐
│ Author │────▸│ Render │────▸│ Read │
└────────┘     └────────┘     └──────┘

Markup

The <Mermaid> widget authors a diagram outside a fence: its source is the default slot's text, or a file read through the page's store, and render pins the form as the info word does.

Choosing the form

The form is the diagram-render cascade property, Auto, Svg or Text, inherited like a text property, so it is set at three grains: an app-wide <Rule> in the rule set, a page root's bx:style="diagram-render=Text", or one diagram's fence info word (mermaid text) and <Mermaid render="Text"> prop. Auto is the picture on the web; on a terminal a flowchart is text, since it reflows to the columns and selects, and every other type a raster where the session's terminal draws kitty graphics, else text. A build without the svg renderer shows the text form for every mode.