# Markdown Mermaid Mermaid renderer for the markdown item, drawn with Pele. A fence renders as a diagram once it closes; while the source streams, or when Pele rejects it, the fence stays a code block. ## Installation ```bash npx shadcn@latest add litingyes/blocove/markdown-mermaid ``` > Typography requires [shadcn/typeset](https://ui.shadcn.com/docs/typeset). Copy `typeset.css` next to your main stylesheet, import it after Tailwind and add the `.typeset-docs` preset. This example also uses: `markdown`. ```bash npx shadcn@latest add litingyes/blocove/markdown ``` A fence with the `mermaid` language becomes a diagram once its closing fence arrives; the source stays readable while the tokens stream. The diagram mounts client-side with Pele: it reads the container width, follows resizes and owns the error display. Colors are the shadcn CSS variables mapped onto `--pele-*`, so a theme switch repaints without re-rendering. Images are disabled and links keep Pele's default schemes. A diagram Pele rejects falls back to the source with a short message. ## API Reference ### MarkdownMermaid The Mermaid fence renderer. The shell passes `language`, `code`, `streaming` and `complete`; register it through `components.fences`. It renders the source until `complete` is set — the closing fence or the final source — then mounts Pele client-side. Extends `MarkdownCodeProps`. | Prop | Type | Default | | --- | --- | --- | | `language` | `string` | `Required` | | `code` | `string` | `Required` | | `streaming` | `boolean` | - | | `complete` | `boolean` | - | | `className` | `string` | - | ## Registry dependencies - `litingyes/blocove/markdown-parse` - `code-block` Namespace: `npx shadcn@latest add @blocove/markdown-mermaid`