streamdown
A drop-in replacement for react-markdown, designed for AI-powered streaming.
What is streamdown?
A drop-in replacement for react-markdown, designed for AI-powered streaming.
Overview of streamdown
What it is
Streamdown is a drop-in replacement for react-markdown, designed for AI-powered streaming. It is built to handle the unique requirements of streaming Markdown content from AI models, providing seamless formatting even with incomplete or unterminated Markdown blocks. It powers the AI Elements Message component but can be installed as a standalone package for your own streaming needs.
Key features
- Drop-in replacement for react-markdown
- Streaming-optimized – handles incomplete Markdown gracefully
- Unterminated block parsing – built with remend for better streaming quality
- GitHub Flavored Markdown – tables, task lists, and strikethrough support
- Math rendering – LaTeX equations via KaTeX
- Mermaid diagrams – render Mermaid diagrams as code blocks with a button to render them
- Code syntax highlighting – beautiful code blocks with Shiki
- Security-first – built with rehype-harden for safe rendering
- Performance optimized – memoized rendering for efficient updates
Use cases
Streamdown is intended for any React application that needs to render streaming Markdown content from AI models. It is particularly useful for chat interfaces, AI assistants, and any scenario where Markdown is received incrementally and may contain incomplete or unterminated blocks.
Getting started
bashnpm i streamdownThen update your Tailwind globals.css to include the following so that Tailwind can detect the utility classes used by Streamdown:css@source “../node_modules/streamdown/dist/*.js”;For more details, including monorepo setup and CSS custom properties, see the repository README.
License and pricing
The license is not stated in the provided metadata or README. The project is listed as open source.
Based on the project's public README and repository metadata.