Streamdown

A drop-in react-markdown replacement built for AI-powered streaming interfaces.

Library
npm
v2.5.0
5,517stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
80/100Excellent
Development Activity88
Maintenance92
Community64
Maturity36
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture85
Code Quality85
Innovation85
Learning Curve70

Streamdown is a React markdown-rendering component purpose-built for the failure modes that show up when you render text as it streams token-by-token from a large language model. Ordinary markdown renderers choke on unterminated code fences, half-written tables, and dangling list markers because they assume a complete, well-formed document; Streamdown instead repairs and parses incomplete markdown incrementally, block by block, so the UI never flashes broken formatting while a response is still arriving.

It ships as a near drop-in swap for react-markdown, adding GitHub Flavored Markdown, KaTeX math, Mermaid diagrams, and Shiki-powered code highlighting out of the box, plus security-first sanitization via rehype-harden. It powers the Message component in Vercel’s AI Elements and AI SDK ecosystem but works standalone in any React app that needs to render streaming AI output.

What You Get

  • A <Streamdown> React component that is a near drop-in replacement for react-markdown, accepting the same components, remarkPlugins, and rehypePlugins props
  • Streaming-safe incremental parsing that repairs unterminated code fences, tables, and lists before each render so output never flashes broken formatting
  • Built-in GitHub Flavored Markdown (tables, task lists, strikethrough) via remark-gfm
  • Optional plugin packages for KaTeX math, Mermaid diagram rendering, Shiki code highlighting with copy/download controls, and CJK-friendly text handling
  • Security-first sanitization by default via rehype-sanitize and rehype-harden, with configurable allowed tags and a link-safety confirmation modal
  • Fine-grained controls for animated character-by-character reveal, RTL/LTR text direction detection, i18n string overrides, and a Tailwind class prefix option

Common Use Cases

  • Rendering assistant responses in an LLM chat UI while the response is still streaming from the model
  • Displaying AI-generated content that mixes prose, code blocks, tables, and diagrams without waiting for the full response to complete
  • Building chat and copilot interfaces on top of the Vercel AI SDK’s useChat hook, where Streamdown is the standard rendering layer for message parts

Under The Hood

Architecture Streamdown’s Streamdown component (packages/streamdown/index.tsx) splits incoming markdown into independently-memoized Block components via parseMarkdownIntoBlocks (lib/parse-blocks.tsx), so only the last, still-changing block re-renders during a stream while earlier blocks stay frozen by React’s memo. Before parsing, the remend sibling package rewrites unterminated markdown constructs (open fences, dangling table rows) so the underlying unified/remark/rehype pipeline never sees invalid input. A single combined StreamdownContext carries theme, controls, and mode state to avoid deep provider nesting, and an internal PluginContext lets optional @streamdown/* packages (math, mermaid, code, cjk) register their own remark/rehype plugins without the core package depending on them directly.

Tech Stack The package is TypeScript-first, targeting React 18/19 as peer dependencies, and is built on the unified ecosystem (remark-parse, remark-gfm, remark-rehype, rehype-sanitize, rehype-raw) with marked’s Lexer used specifically for block-boundary detection. Sanitization is hardened via rehype-harden, and styling uses clsx + tailwind-merge with a custom createCn prefixing helper so consumers on Tailwind v4’s prefix() feature aren’t broken. It’s published from a Turborepo/pnpm monorepo (packages/streamdown plus sibling remend, @streamdown/code, @streamdown/math, @streamdown/mermaid, @streamdown/cjk) built with tsup.

Code Quality The streamdown package alone has 75 test files under __tests__/ covering individual concerns (footnotes, RTL support, code-block hydration, KaTeX lazy-loading, link safety, mermaid pan/zoom, table CSV export, etc.), plus a __benchmarks__/ suite comparing performance directly against react-markdown. CI (.github/workflows) runs pnpm test and pnpm check (Biome/Ultracite lint + format) on every push. Source comments frequently explain non-obvious performance and correctness decisions (e.g. why block keys are index-based rather than content-hash-based, why a regex was changed to fix a footnote-matching bug), indicating an actively maintained, defect-aware codebase.

API Design The component intentionally mirrors react-markdown’s prop surface (components, remarkPlugins, rehypePlugins) so migration is close to a one-line import swap, while layering streaming-specific props (mode, isAnimating, parseIncompleteMarkdown, animated) with sensible defaults (mode="streaming", sanitization on, controls on). Optional capabilities (math, mermaid, code highlighting, CJK handling) are opt-in via a plugins prop backed by separate installable packages, keeping the core bundle lean for consumers who don’t need them.

Used by 45 apps in this directory

TypeScript
59%
Other

agenta

Developer Tools · Devops · AI Development

4,489

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript59%
Python39%
Updated today
TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

32,102

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript95%
Updated today
TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
Python
68%
Other

AutoGPT

Automation · Productivity · AI Assistants

186,687

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
67
Dependency
Built with
Python68%
TypeScript31%
Updated today
TypeScript
49%
AGPL 3.0

BrowserOS

Browser · AI Assistants

13,248

The open-source agentic Chromium browser with native AI agents, MCP server, and visual workflow automation — your data never leaves your machine.

View details
87
Repo Health
82
Technical
69
Dependency
Built with
TypeScript49%
Rust22%
Python16%
Updated today
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

50,753

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
88
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
TypeScript
97%
Apache 2.0

Cline

AI Code Assistants

66,453

An open-source AI coding agent that lives in your editor and terminal — reads and edits your codebase, runs commands, browses the web, and requires human approval for every action by default.

View details
90
Repo Health
74
Technical
67
Dependency
Built with
TypeScript97%
Updated today
Go
76%
AGPL 3.0

Coder

Devops · Developer Tools · Code Editors

14,199

Self-hosted cloud development environments and AI coding agents — defined in Terraform, connected via WireGuard, automatically shut down when idle.

View details
93
Repo Health
90
Technical
71
Dependency
Built with
Go76%
TypeScript22%
Updated today
TypeScript
50%
Other

Dify

No Code Platforms · AI Development · Developer Tools

152,883

Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.

View details
92
Repo Health
85
Technical
71
Dependency
Built with
TypeScript50%
Python47%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search