The problem with streaming Markdown
When you stream Markdown content from AI models, traditional renderers weren’t designed for the challenges that emerge:- Incomplete syntax — Bold text that hasn’t been closed yet:
**This is bol - Partial code blocks — Code blocks missing their closing backticks
- Unterminated links — Links without closing brackets:
[Click here - Progressive rendering — Content that updates token-by-token
react-markdown will either render these incomplete elements incorrectly or not at all, creating a jarring user experience during streaming.
The Streamdown solution
Streamdown intelligently handles incomplete Markdown by:- Parsing incomplete blocks — Automatically detects and completes unterminated Markdown syntax via the
remendengine - Progressive formatting — Applies styling to partial content as it streams in
- Seamless transitions — Smoothly updates from incomplete to complete states
- Zero configuration — Works out of the box with sensible defaults
Key features
Drop-in replacement
Identical API to
react-markdown — swap it in with no code changes required.Streaming-optimized
Built from the ground up to handle streaming AI output gracefully.
Remend engine
Automatically completes incomplete bold, italic, code, links, and more.
GitHub Flavored Markdown
Tables, task lists, and strikethrough support out of the box.
Rich plugin ecosystem
Syntax highlighting, math (KaTeX), diagrams (Mermaid), and CJK support.
Security-first
Built with
rehype-harden and rehype-sanitize for safe rendering.Performance optimized
Memoized rendering, React Transitions, and stable block keys for efficient updates.
Customizable
Override components, themes, icons, translations, and CSS variables.
Packages
The Streamdown ecosystem consists of these npm packages:| Package | Description |
|---|---|
streamdown | Core React component |
remend | Self-healing markdown preprocessor (standalone) |
@streamdown/code | Shiki syntax highlighting plugin |
@streamdown/math | KaTeX math rendering plugin |
@streamdown/mermaid | Mermaid diagram plugin |
@streamdown/cjk | CJK text handling plugin |
Quick start
Getting started
Install and configure Streamdown in your project
Usage guide
Learn the full API with real-world examples
Plugins
Add syntax highlighting, math, and diagrams
API reference
Full props reference for the Streamdown component
