Live Demo Β· Cloudflare Pages

πŸ§œβ€β™€οΈ astro-mermaid-satteri Integration

A complete example of using Mermaid diagrams in Astro projects with theastro-mermaid-satteriintegration β€” automatic theme switching, icon pack support, and all diagram types.

13
Diagram Types
0
External Dependencies
100%
Client-Side

How it works β€” request flow

graph TD
    A[User] -->|request| B(Cloudflare Pages)
    B --> C{Astro Build}
    C -->|static HTML| D[Mermaid renders client-side]
    D --> E[SVG output]
    E --> A

πŸ“‚ Diagram Gallery

Click any card to see a full-page example with live rendering:

βš™οΈ How It Works

Add the integration to your astro.config.mjs:

// astro.config.mjs
import { defineConfig } from 'astro/config';
import { satteri } from '@astrojs/markdown-satteri';
import mermaid from 'astro-mermaid-satteri';

export default defineConfig({
  markdown: { processor: satteri() },
  integrations: [
    mermaid({
      theme: 'forest',
      autoTheme: true,
      iconPacks: [
        { name: 'logos', url: 'https://unpkg.com/@iconify-json/logos@1/icons.json' }
      ]
    })
  ]
});

Then just use fenced mermaid code blocks in any markdown file:

```mermaid
graph LR
    A --> B --> C
```
All diagrams are rendered client-sidewith zero external dependencies β€” your diagram content never leaves the browser.