Streamdown is a React component library that renders Markdown with support for streaming content from AI models.
The core problem Streamdown addresses is that standard Markdown renderers struggle when content arrives incrementally as tokens from an AI stream. Incomplete or unterminated Markdown blocks cause formatting to break or render incorrectly. Streamdown handles this by parsing and displaying Markdown gracefully even when blocks are partial or malformed, allowing the content to update smoothly as new tokens arrive. It achieves this through streaming-optimized parsing built on top of rehype and remark, combined with memoized rendering to avoid unnecessary recalculations.
Streamdown is designed as a drop-in replacement for react-markdown, so teams already using that library can switch with minimal code changes. It suits projects that stream AI-generated content to users, particularly those using the Vercel AI SDK. The tool includes built-in support for GitHub Flavored Markdown, LaTeX math rendering via KaTeX, Mermaid diagram rendering, syntax-highlighted code blocks via Shiki, and security hardening through rehype-harden. It uses Tailwind CSS for styling and integrates with shadcn/ui's design system, requiring CSS custom properties to be configured in your project.
The project shows active development with regular updates addressing streaming edge cases and adding plugin support for optional features like math rendering, code highlighting, and CJK text handling. Documentation is comprehensive and includes setup guidance for both standard and monorepo environments, with clear instructions for configuring Tailwind and CSS variables. The codebase is maintained with attention to performance optimization and security considerations specific to rendering untrusted AI-generated content.