Labsco
vercel logo

streamdown

✓ Official★ 5,367

by vercel · part of vercel/streamdown

Implement, configure, and customize Streamdown — a streaming-optimized React Markdown renderer with syntax highlighting, Mermaid diagrams, math rendering, and CJK support. Use when working with Streamdown setup, configuration, plugins, styling, security, or integration with AI streaming (e.g., Vercel AI SDK). Triggers on: (1) Installing or setting up Streamdown, (2) Configuring plugins (code, mermaid, math, cjk), (3) Styling or theming Streamdown output, (4) Integrating with AI chat/streaming, (

🔥🔥🔥🔥✓ VerifiedFreeQuick setup
🧰 Not standalone. This skill ships with vercel/streamdown and only works together with that tool — install the tool first, then add this skill.

This is the playbook your agent receives when the skill activates — you don't need to read it to use the skill, but it's here to audit before installing.

Streamdown

Streaming-optimized React Markdown renderer. Drop-in replacement for react-markdown with built-in streaming support, security, and interactive controls.

Key Props

PropTypeDefaultPurpose
childrenstring—Markdown content
mode"streaming" | "static""streaming"Rendering mode
plugins{ code?, mermaid?, math?, cjk? }—Feature plugins
isAnimatingbooleanfalseStreaming indicator
caret"block" | "circle"—Cursor style
componentsComponents—Custom element overrides
controlsboolean | objecttrueInteractive buttons; download: { filename } sets custom download names
linkSafetyLinkSafetyConfig{ enabled: true }Link confirmation modal
shikiTheme[light, dark]['github-light', 'github-dark']Code themes
classNamestring—Container class
allowedElementsstring[]allTag names to allow
disallowedElementsstring[][]Tag names to disallow
allowElementAllowElement—Custom element filter
unwrapDisallowedbooleanfalseKeep children of disallowed elements
skipHtmlbooleanfalseIgnore raw HTML
urlTransformUrlTransformdefaultUrlTransformTransform/sanitize URLs

For full API reference, see references/api.md.

Plugin Quick Reference

PluginPackagePurpose
Code@streamdown/codeSyntax highlighting (Shiki, 200+ languages)
Mermaid@streamdown/mermaidDiagrams (flowcharts, sequence, etc.)
Math@streamdown/mathLaTeX via KaTeX (requires CSS import)
CJK@streamdown/cjkChinese/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:

Common Gotchas

  1. Tailwind styles missing — Add @source directive or content entry for node_modules/streamdown/dist/*.js
  2. Math not rendering — Import katex/dist/katex.min.css
  3. Caret not showing — Both caret prop AND isAnimating={true} are required
  4. Copy buttons during streaming — Disabled automatically when isAnimating={true}
  5. Link safety modal appearing — Enabled by default; disable with linkSafety={{ enabled: false }}
  6. Shiki warning in Next.js — Install shiki explicitly, add to transpilePackages
  7. allowedTags not working — Only works with default rehype plugins
  8. Math uses $$ not $ — Single dollar is disabled by default to avoid currency conflicts