I got it to work with:

const config = {

  markdown: {
    mermaid: true,
  },
  themes: ['@docusaurus/theme-mermaid'],

... rest of the code

};
Answer from etho201 on Stack Overflow
🌐
Docusaurus
docusaurus.io › guides › markdown features › diagrams
Diagrams | Docusaurus
March 6, 2026 - Enable Mermaid functionality by adding plugin @docusaurus/theme-mermaid and setting markdown.mermaid to true in your docusaurus.config.js.
Discussions

Docusaurus getting mermaid up and running - Stack Overflow
[docusaurus] Newbie question: I am attempting to get mermaid up and running on my website, but am struggling to implement https://docusaurus.io/docs/markdown-features/diagrams. More on stackoverflow.com
🌐 stackoverflow.com
Live or demo Docusarurus sites with Mermaid
The main Docusaurus site https://docusaurus.io demonstrates all features of Docusaurus included in the base install or official packages. https://docusaurus.io/docs/markdown-features/diagrams More on reddit.com
🌐 r/Docusaurus
3
1
March 24, 2026
Mermaid diagrams do not render text nodes (empty `foreignObject`)
Docusaurus 3.5.2 (but in my testings it's reproducible with many other, if not all, 3.x.x versions) Mermaid diagrams are rendered with empty text nodes. More on github.com
🌐 github.com
8
September 27, 2024
is possible to use mermaid beta diagrams (architecture-beta)?
However the list of v11 breaking changes is small: https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0 · It is likely that we could add support for v11 simply by updating our semver range and allowing to use v11 versions. It probably doesn't require a Docusaurus breaking change (ie ... More on github.com
🌐 github.com
4
1
September 19, 2024
🌐
npm
npmjs.com › package › @docusaurus › theme-mermaid
docusaurus/theme-mermaid
July 10, 2026 - Mermaid components for Docusaurus.. Latest version: 3.10.2, last published: 2 months ago. Start using @docusaurus/theme-mermaid in your project by running `npm i @docusaurus/theme-mermaid`. There are 24 other projects in the npm registry using @docusaurus/theme-mermaid.
      » npm install @docusaurus/theme-mermaid
    
Published: Jul 10, 2026
Version: 3.10.2
🌐
Simonpainter
simonpainter.com › mermaid-icons
Custom icons for Mermaid diagrams in Docusaurus | Simon Painter
September 24, 2025 - This has been addressed by using the Iconify library which has a large collection of open source icons. Combined with the architecture-beta diagram type in Mermaid it is possible to create some great looking diagrams that go beyond the basic flow diagrams I have been using until now. I have added support in my Docusaurus site for one of the icon sets.
🌐
GitHub
github.com › facebook › docusaurus › issues › 10526
Mermaid diagrams do not render text nodes (empty `foreignObject`) · Issue #10526 · facebook/docusaurus
September 27, 2024 - Docusaurus 3.5.2 (but in my testings it's reproducible with many other, if not all, 3.x.x versions) Mermaid diagrams are rendered with empty text nodes.
Author: facebook
Find elsewhere
🌐
Timkolberger
timkolberger.github.io › docusaurus-plugin-structurizr
docusaurus-plugin-structurizr | Docusaurus Plugin Structurizr
format: 'mermaid', // "mermaid" | "plantuml" | <Structurizr export format: https://docs.structurizr.com/cli/export>
🌐
Sjwall
sjwall.github.io › examples
Examples | mdx-mermaid
Mermaid config can be configured through the plugin config: docusaurus.config.js · { mermaid: { theme: 'dark' } } caution · When passing config to the <Mermaid> component only the first instance should have the config passed to it. If no config is passed to any component then Mermaid will not initialize.
🌐
Stack Overflow
stackoverflow.com › questions › 77986830 › docusaurus-config-syntax-unclear
Docusaurus config - syntax unclear - Stack Overflow
const config = { markdown: { mermaid: true, }, themes: ['@docusaurus/theme-mermaid'], ...the rest of the code that's already in there...
🌐
GitHub
github.com › facebook › docusaurus › issues › 1258
OOTB Mermaid code block · Issue #1258 · facebook/docusaurus
March 11, 2020 - 🚀 Feature mermaidjs seems to be a pretty neat tool that allows drawing diagrams using markdown. It'd be nice if Docusaurus can be integrated with that. Have you read the Contributing Guidelines on ...
Author: facebook