November 27, 2026 - Mermaid diagrams
A new Mermaid extension adds diagram blocks with copy, edit and delete actions, a split code and live preview editor, a toolbar button, a slash command, and Static Renderer support.
Docs, specs and knowledge-base editors can now draw flowcharts, sequence diagrams and other charts with the new Mermaid extension. Thanks to Santos Vilanculos for building the first version.
$ pnpm dlx shadcn@latest add @editorcn/mermaid
Highlights
- Diagram-first blocks: a diagram shows only the drawing. Hover it, or tap it on touch screens, to copy the source, edit it or delete the block. Double-click to edit.
- Split editor: edit shows the source next to a live preview that redraws 300ms after you stop typing, with code, split and preview layouts. Apply (Cmd/Ctrl+Enter) saves the change as one undo step, and Cancel (Esc) discards it.
- Toolbar and slash command: a
MermaidToolbarbutton for the toolbar editor and a Diagram slash command item for the block editor. - Light and dark: diagrams follow the
darkclass on<html>, and syntax errors show above the last diagram that worked. - Loaded on demand: Mermaid is imported the first time a diagram renders, so it stays out of your initial bundle, and runs with
securityLevel: "strict". - Markdown: with the Markdown extension, diagrams round-trip as fenced
mermaidblocks. - Static Renderer: diagrams render as a card with their source, and
MermaidDiagramsdraws them on the client in HTML or JSON mode. - Mobile: larger tap targets, no zoom when the source box gets focus on iOS, and a stacked layout on narrow screens.
The landing page editors and the Full Toolbar Editor and Full Block Editor templates now include it.
Upgrading
shadcn registry
Add the extension, and re-add the static renderer if you use it to get the diagram card:
$ pnpm dlx shadcn@latest add @editorcn/mermaid @editorcn/static-renderer
Installing Mermaid doesn't change the shared extensions/core files, so it won't ask to overwrite anything from your other extensions.
npm
Update to @editorcn/static-renderer@0.6.0. See its changelog.
Ready-made editor apps built on editorcn: a chat composer, a document editor, a blog post editor, and a Notion-style notes workspace. Install them with the shadcn CLI.