Streamdown: The `react-markdown` Replacement for AI Streaming
Streamdown: a `react-markdown` replacement for AI streaming, featuring GFM, CJK support, interactive code blocks, math, security, and elegant styling.
Introducing Streamdown, a powerful drop-in replacement for react-markdown meticulously designed for AI-powered streaming applications.
Streamdown prioritizes performance, security, and a seamless user experience for dynamically generated content.
Ready to get started? Read the documentation or install it directly:
npm i streamdown
Key Features:
Built-in Typography Styles
Streamdown comes equipped with integrated Tailwind CSS classes, providing beautiful, consistent styling for common Markdown components such as headings, lists, code blocks, and more, right out of the box.
GitHub Flavored Markdown (GFM)
Enjoy full compatibility with GitHub Flavored Markdown (GFM) from day one. Streamdown seamlessly renders features like task lists, tables, and other GFM extensions, enhancing your content presentation.
CJK Language Support
Critical for AI-generated content, Streamdown offers robust, built-in support for Chinese, Japanese, and Korean languages. This ensures that emphasis markers function correctly even with ideographic punctuation, delivering accurate rendering.
Beautiful, Interactive Code Blocks
Leveraging Shiki, Streamdown delivers stunning syntax highlighting for code blocks. Each code block also includes convenient copy and download buttons within its header for enhanced user experience.
Mathematical Expressions
Integrate complex mathematical notation effortlessly. Streamdown supports LaTeX math expressions via remark-math and KaTeX, allowing for elegant and precise rendering of your equations within Markdown.
Graceful Handling of Unterminated Markdown Blocks
Streamdown includes built-in support for parsing and styling incomplete or 'unterminated' Markdown blocks (e.g., # headings, `inline code`, **bold**, _italic_, [links]()). This feature significantly enhances the visual experience of streaming Markdown content, making it appear much smoother and more polished during live generation.
Built-in Security Hardening
Security is paramount. Streamdown provides integrated hardening measures to prevent untrusted Markdown from embedding images or linking to unexpected origins, thereby mitigating risks like prompt injection attacks and ensuring content integrity.
Upgrade Your AI-Powered Streaming
Ready to elevate your AI-powered applications? Try Streamdown today and unlock a new level of performance, security, and user experience for your streaming Markdown content.
Made with 🖤 and 🤖 by Vercel. View the source code.