svelte/markdown.
A powerful, customizable markdown and HTML renderer for Svelte 5 — built for rendering streaming output from AI agents like Claude Code and ChatGPT. 24 renderers, 83 HTML tags, token caching, XSS-safe defaults, and allow/deny utilities, all fully typed.
stream AI responses in real-time.
Render ChatGPT, Claude, and Gemini responses as they stream in. Smart token diffing keeps each update at a median ~3ms — well under the 60fps budget.
why svelte-markdown.
The most complete markdown renderer for Svelte 5 applications.
Full Markdown Support
GitHub Flavored Markdown with 24 built-in renderers for headings, tables, code blocks, lists, and more.
HTML Tag Rendering
83 HTML tags supported with allow/deny controls to filter exactly which tags render.
Custom Renderers
Override any renderer with your own Svelte components for full control over markdown output.
Svelte 5 Snippets
Override renderers inline with Svelte 5 snippets — no separate component files needed.
TypeScript First
Full type safety with generics. All props, renderers, and options are properly typed.
AI Agent Output
Render streaming HTML and markdown from Claude Code, ChatGPT, and agentic workflows — with XSS defaults, sanitization-aware streaming, and low-latency updates (median ~3ms, well under the 60fps budget).
live playground.
Edit markdown on the left, see it rendered on the right.
how we compare.
Honest, side-by-side comparisons with every major Svelte markdown library and editor.
| library | category | streaming html | svelte 5 | custom renderers | allow/deny html | read more |
|---|---|---|---|---|---|---|
| @humanspeak/svelte-markdown ● | renderer | yes | yes | yes | yes | this row |
| MDsveX | Preprocessor | no | — | yes | Via rehype plugins | read more |
| Tiptap | Rich Text Editor | no | — | Via node views | Via schema | read more |
| markdown-it | Markdown Parser | no | — | Token stream manipulation | no | read more |
| marked | Markdown Parser | no | — | Token manipulation | no | read more |
| Milkdown | WYSIWYG Markdown Editor | no | — | Via ProseMirror nodes | Via ProseMirror schema | read more |
| svelte-exmarkdown | Runtime Renderer | no | — | yes | Via rehype plugins | read more |
| Carta | Markdown Editor + Viewer | no | — | Via plugins | Via rehype-sanitize | read more |
| ByteMD | Markdown Editor | no | — | Via plugins | Via sanitize schema | read more |
| unified / remark | Content Processing Pipeline | no | — | AST transformers | no | read more |
explore interactive examples.
See agent streaming, custom renderers, HTML filtering, marked extensions, Mermaid diagrams, and more — all with live editors.
Agent Output + Live Sanitization
Watch a simulated agent stream mixed markdown and HTML — with a live log of every javascript: URL and on*= handler the sanitizer blocks.
AI Agent / LLM Streaming
Stream markdown and rich HTML from AI agents in real time. Adjustable speed, jitter, and chunk modes with live render performance.
Live Playground
Edit markdown in real-time and see it rendered instantly. Mix markdown with HTML tags.
Custom Renderers
Override default renderers and control which markdown elements are rendered with your own Svelte components.
HTML Filtering
Interactive demo of allow/deny controls for HTML tags within markdown content.
Snippet Overrides
Customize rendering inline with Svelte 5 snippets. No separate component files needed.