Streamdown

Streamdown is a streaming-first markdown renderer built for AI applications. It handles incomplete syntax gracefully, supports rich plugins for code highlighting, mathematics, and diagrams, and provides a drop-in replacement for react-markdown.

What is Streamdown?

Traditional markdown renderers expect complete, valid markdown input. Streamdown is different — it's designed to render markdown as it arrives, token by token, from an AI model or any streaming source. This means:

  • Unterminated code blocks are displayed with temporary styling
  • Incomplete tables render as far as possible
  • Partial LaTeX expressions are shown as raw text until complete
  • Progressive rendering feels smooth and natural

Live demo

Watch Streamdown render a markdown document in real-time:

Complete

Quick start

bash
bun add streamdown @streamdown/code @streamdown/math
components/renderer.tsx
"use client"

import { Streamdown } from "streamdown"
import { code } from "@streamdown/code"
import { math } from "@streamdown/math"
import "katex/dist/katex.min.css"

export function Renderer({ content }: { content: string }) {
  return (
    <Streamdown plugins={{ code, math }}>
      {content}
    </Streamdown>
  )
}

All plugins optional

Streamdown works without any plugins. Add only the ones you need for code highlighting, maths, diagrams, or CJK support.

Explore plugins