π§ββοΈ 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.
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:
π Flowchart
Directed and undirected flowcharts with various node shapes and styles
π Sequence
Show interactions between actors and participants over time
π« Class
Object-oriented class relationships and structure
π State
Finite state machines and state transitions
ποΈ Entity Relationship
Database schema and entity relationships
π Gantt
Project scheduling and task timelines
π₯§ Pie Chart
Proportional data visualization
πΊοΈ User Journey
Map user experience across steps and satisfaction levels
πΏ Git Graph
Branch and commit history visualization
π§ Mindmap
Hierarchical brainstorming and concept maps
β³ Timeline
Chronological events and milestones
π Quadrant
Two-axis matrix for categorizing items
π’ C4 Model
Context, Container, and Component diagrams with icon packs
βοΈ 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.