StreamMDX

StreamMDX

High-performance streaming Markdown/MDX renderer for React.

$npm install stream-mdx
Proof, not promises
Worker-first parsing
  • Off-main-thread MDX compilation.
  • Zero-latency UI interactions.
  • Incremental AST hydration.
Architecture
Patch-based rendering
  • Tail block updates only.
  • Stable finalized blocks.
  • Minimal DOM reflows.
View demo
Output locked
  • HTML snapshot locks.
  • Regression protection.
  • Incremental checkouts.
Testing docs
Feature highlights

Everything you need for production-grade streaming MDX.

Incremental Shiki

Highlight code blocks as they stream without flicker or layout shifts.

Rendering guide
Full MDX support

Import and render React components directly within your markdown stream.

MDX guide
HTML overrides

Map standard markdown elements to your design system components.

HTML showcase
Math & Mermaid

First-class KaTeX and Mermaid diagrams via optional plugins.

Mermaid guide
Format anticipation

Regex-based plugins to predict and format content early.

Format guide
Security model

Built-in sanitization and CSP-friendly rendering for untrusted output.

Security docs