
Streamdown
OfficialFreeStreaming-optimized React Markdown renderer.
Free · Opens the source repo
What Streamdown does
Streamdown is a specialized React Markdown renderer designed for streaming applications, providing a drop-in replacement for react-markdown. It offers built-in support for syntax highlighting, Mermaid diagrams, math rendering, and CJK (Chinese, Japanese, Korean) text. This makes it particularly useful for developers looking to create interactive and visually rich markdown content, especially in environments that require real-time updates or streaming capabilities.
The setup process is straightforward, requiring only a few lines of code to integrate into your React application. After installation, developers can configure Tailwind CSS for styling, ensuring that the Streamdown component renders correctly. The renderer supports various plugins that can be selectively installed based on project needs, allowing for a customized experience without unnecessary bloat.
Streamdown is particularly beneficial for applications that involve AI streaming, such as those using the Vercel AI SDK. It allows for dynamic rendering of markdown content in chat interfaces, enhancing user interaction. Additionally, it includes features for security, such as link safety and customizable HTML tags, which are essential for production environments where user-generated content is involved.
For those working on documentation or blogs, Streamdown’s static mode provides an efficient way to render markdown content without the need for streaming. This versatility makes it suitable for a wide range of applications, from interactive chatbots to static documentation sites.
When to use it
Use Streamdown when you need a markdown renderer that supports real-time updates and interactive features, particularly in AI-driven applications.
When not to use it
If your project does not require streaming capabilities or if you are using a different framework than React, Streamdown may not be the right choice.
What you can build with it
Integrating with AI Chat
Use Streamdown to render markdown content in real-time within an AI chat application, enhancing user interaction.
Creating Interactive Documentation
Leverage Streamdown's static mode to build rich, interactive documentation that supports diagrams and mathematical expressions.
Customizing Markdown Rendering
Utilize Streamdown's plugin architecture to tailor the markdown rendering experience to your project's specific needs.
How to install Streamdown
View source1. Install with the skills CLI
npx skills add vercel/streamdown/streamdown --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by vercelStreamdown
Streaming-optimized React Markdown renderer. Drop-in replacement for react-markdown with built-in streaming support, security, and interactive controls.
Quick Setup
1. Install
npm install streamdown
Optional plugins (install only what's needed):
npm install @streamdown/code @streamdown/mermaid @streamdown/math @streamdown/cjk
2. Configure Tailwind CSS (Required)
This is the most commonly missed step. Streamdown uses Tailwind for styling and the dist files must be scanned.
Tailwind v4 — add to globals.css:
@source "../node_modules/streamdown/dist/*.js";
Add plugin @source lines only for packages you have installed (omitting uninstalled plugins avoids Tailwind errors). See plugin pages for exact paths:
- Code:
@source "../node_modules/@streamdown/code/dist/*.js"; - CJK:
@source "../node_modules/@streamdown/cjk/dist/*.js"; - Math:
@source "../node_modules/@streamdown/math/dist/*.js"; - Mermaid:
@source "../node_modules/@streamdown/mermaid/dist/*.js";
Tailwind v3 — add to tailwind.config.js:
module.exports = {
content: [
"./app/**/*.{js,ts,jsx,tsx,mdx}",
"./node_modules/streamdown/dist/*.js",
],
};
3. Basic Usage
import { Streamdown } from 'streamdown';
<Streamdown>{markdown}</Streamdown>
4. With AI Streaming (Vercel AI SDK)
'use client';
import { useChat } from '@ai-sdk/react';
import { Streamdown } from 'streamdown';
import { code } from '@streamdown/code';
export default function Chat() {
const { messages, input, handleInputChange, handleSubmit, isLoading } = useChat();
return (
<>
{messages.map((msg, i) => (
<Streamdown
key={msg.id}
plugins={{ code }}
caret="block"
isAnimating={isLoading && i === messages.length - 1 && msg.role === 'assistant'}
>
{msg.content}
</Streamdown>
))}
<form onSubmit={handleSubmit}>
<input value={input} onChange={handleInputChange} disabled={isLoading} />
</form>
</>
);
}
5. Static Mode (Blogs, Docs)
<Streamdown mode="static" plugins={{ code }}>
{content}
</Streamdown>
Key Props
| Prop | Type | Default | Purpose |
|---|---|---|---|
children | string | — | Markdown content |
mode | "streaming" | "static" | "streaming" | Rendering mode |
plugins | { code?, mermaid?, math?, cjk? } | — | Feature plugins |
isAnimating | boolean | false | Streaming indicator |
caret | "block" | "circle" | — | Cursor style |
components | Components | — | Custom element overrides |
controls | boolean | object | true | Interactive buttons |
linkSafety | LinkSafetyConfig | { enabled: true } | Link confirmation modal |
shikiTheme | [light, dark] | ['github-light', 'github-dark'] | Code themes |
className | string | — | Container class |
allowedElements | string[] | all | Tag names to allow |
disallowedElements | string[] | [] | Tag names to disallow |
allowElement | AllowElement | — | Custom element filter |
unwrapDisallowed | boolean | false | Keep children of disallowed elements |
skipHtml | boolean | false | Ignore raw HTML |
urlTransform | UrlTransform | defaultUrlTransform | Transform/sanitize URLs |
For full API reference, see references/api.md.
Plugin Quick Reference
| Plugin | Package | Purpose |
|---|---|---|
| Code | @streamdown/code | Syntax highlighting (Shiki, 200+ languages) |
| Mermaid | @streamdown/mermaid | Diagrams (flowcharts, sequence, etc.) |
| Math | @streamdown/math | LaTeX via KaTeX (requires CSS import) |
| CJK | @streamdown/cjk | Chinese/Japanese/Korean text support |
Math requires CSS:
import 'katex/dist/katex.min.css';
For plugin configuration details, see references/plugins.md.
References
Use these for deeper implementation details:
- references/api.md — Complete props, types, and interfaces
- references/plugins.md — Plugin setup, configuration, and customization
- references/styling.md — CSS variables, data attributes, custom components, theme examples
- references/security.md — Hardening, link safety, custom HTML tags, production config
- references/features.md — Carets, remend, static mode, controls, GFM, memoization, troubleshooting
Example Configurations
Copy and adapt from assets/examples/:
- basic-streaming.tsx — Minimal AI chat with Vercel AI SDK
- with-caret.tsx — Streaming with block caret cursor
- full-featured.tsx — All plugins, carets, link safety, controls
- static-mode.tsx — Blog/docs rendering
- custom-security.tsx — Strict security for AI content
Common Gotchas
- Tailwind styles missing — Add
@sourcedirective orcontententry fornode_modules/streamdown/dist/*.js - Math not rendering — Import
katex/dist/katex.min.css - Caret not showing — Both
caretprop ANDisAnimating={true}are required - Copy buttons during streaming — Disabled automatically when
isAnimating={true} - Link safety modal appearing — Enabled by default; disable with
linkSafety={{ enabled: false }} - Shiki warning in Next.js — Install
shikiexplicitly, add totranspilePackages allowedTagsnot working — Only works with default rehype plugins- Math uses
$$not$— Single dollar is disabled by default to avoid currency conflicts
Frequently asked questions about Streamdown
Similar skills
Playwright Component Testing
Test React and Vue components in isolation with Playwright.
Fluent UI Blazor
Integrate Fluent UI components in Blazor applications effortlessly.
Build MCP App
Create interactive UI widgets for MCP servers.
Web Design Reviewer
Identify and fix design issues in websites efficiently.
Markstream Install
Seamlessly integrate Markstream for Markdown rendering.
GSAP & Framer Scroll Animation
Create advanced scroll animations effortlessly.
