APIToGoAPIToGo
Visit APIToGo on LinkedIn
  • Documentation
  • Components
  • Themes
Quickstart
Configuration
Writing
Concepts
OpenAPI
Authentication
Integrations
Guides
    Static FilesEnvironment VariablesCustom pagesMermaid DiagramsMultiple APIsAPI Keys and IdentitiesNavigation RulesTransforming Operation ExamplesSchema Processors
Deployment
Extending
powered by apitogo
Guides

Mermaid Diagrams

APIToGo supports rendering Mermaid diagrams in two ways:

ApproachProsCons
Build-Time (rehype-mermaid)• Faster page loads
• No client-side JS needed
• SEO friendly
• Requires playwright
• Slower builds
• Static only
Client-Side (<Mermaid />)• Fast builds
• Can be dynamic
• No build dependencies
• Requires client-side JS
• Slight render delay

Client-Side Rendering

For the <Mermaid /> component, install the peer dependency:

TerminalCode
npm install mermaid

Then use in your MDX files (no import needed):

Code
<Mermaid chart={`graph TD; A-->B; A-->C;`} />

Outside of MDX, import from @lukoweb/apitogo/mermaid:

Code
import { Mermaid } from "@lukoweb/apitogo/mermaid";

See the Mermaid component documentation for full details.

Build-Time Rendering

  1. Install dependencies:

    TerminalCode
    npm install rehype-mermaid npm install -D playwright npx playwright install
  2. Add to zudoku.build.ts:

    zudoku.build.ts
    import rehypeMermaid from "rehype-mermaid"; export default { rehypePlugins: (plugins) => [[rehypeMermaid, { strategy: "inline-svg" }], ...plugins], };
  3. Use in markdown with code blocks:

    MDXCode
    ```mermaid graph TD; A-->B; ```
Last modified on March 31, 2026
Custom pagesMultiple APIs
On this page
  • Client-Side Rendering
  • Build-Time Rendering
React
React
React