Diagrammo in Fumadocs

Add the plugin, then write a diagram in any Markdown page.

See it live — every chart type rendered through Fumadocs, refreshed on each release.

1.Install

bash
pnpm add fumadocs-dgmo @diagrammo/dgmo

Two small edits to your Fumadocs site. First, wire the remark plugin in source.config.ts:

ts
import { defineConfig, defineDocs } from 'fumadocs-mdx/config';
import { withDgmo } from 'fumadocs-dgmo/config';

export default defineConfig({
  mdxOptions: withDgmo(),
});

export const docs = defineDocs({
  dir: 'content/docs',
});

Then drop <DgmoClient /> into app/layout.tsx inside <RootProvider>:

tsx
import './global.css';
import { RootProvider } from 'fumadocs-ui/provider';
import { DgmoClient } from 'fumadocs-dgmo/client';
import type { ReactNode } from 'react';

export default function Layout({ children }: { children: ReactNode }) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body>
        <RootProvider>
          {children}
          <DgmoClient />
        </RootProvider>
      </body>
    </html>
  );
}

<DgmoClient /> rebinds viewBox tightening + copy buttons on every soft route change AND auto-imports the theme-aware stylesheet — no separate @import in global.css needed.

2.Use

In any .md or .mdx file under content/docs/

markdown
```dgmo
pie Browser Market Share (2025)
Chrome 63.5
Safari 19.8
Firefox  6.2
Edge     5.1
Other    5.4
```

Produces

Pie chart with 5 slices totalling 100; the largest is Chrome at 64%.Browser Market Share (2025)Chrome — 63.5 (64%)Safari — 19.8 (20%)Firefox — 6.2 (6%)Edge — 5.1 (5%)Other — 5.4 (5%)
pie Browser Market Share (2025)

Chrome           63.5
Safari           19.8
Firefox           6.2
Edge              5.1
Other             5.4

Fumadocs UI's color-mode toggle flips each diagram between its palette light and dark variants — no extra config. Every block is rendered twice at build time (light + dark SVG) and CSS hides the wrong one based on html.dark.

Everywhere else it goes

Keep the embedded diagram current

A live link shows the latest version wherever it is embedded, so editing the diagram once updates every place that holds it.