Streamdown is designed from the ground up for streaming. When an AI model sends tokens one at a time, Streamdown parses, memoizes, and renders them efficiently without blocking the browser UI.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/vercel/streamdown/llms.txt
Use this file to discover all available pages before exploring further.
How streaming mode works
Streamdown operates inmode="streaming" by default. In this mode, the component:
- Preprocesses the raw markdown string through the
remendengine to complete any unterminated syntax - Splits the result into independent blocks using
parseMarkdownIntoBlocks - Wraps block updates in a React Transition so they never block higher-priority user interactions
- Memoizes each block so only the last (incomplete) block re-renders on each token arrival
Block-based parsing
TheparseMarkdownIntoBlocks function splits a markdown string into top-level blocks — paragraphs, headings, code fences, tables, and HTML blocks — using the marked lexer. Each block is rendered as a separate memoized Block component.
This means that when a new token arrives, only the last block (which is still being written) triggers a re-render. All previous completed blocks stay memoized and untouched.
parseMarkdownIntoBlocksFn prop:
Footnotes
When the markdown contains footnote references ([^1]) or definitions ([^1]:), the entire document is returned as a single block. This keeps footnote anchors and their definitions in the same MDAST tree so they link correctly.
React Transitions for non-blocking updates
Block updates in streaming mode are wrapped withstartTransition. This marks the state update as non-urgent, so React can interrupt it to handle user input (clicks, typing) without the UI freezing.
When the animated prop is active, updates bypass the transition and apply synchronously so that the animate plugin can track character counts across renders.
parseIncompleteMarkdown prop
TheparseIncompleteMarkdown prop (default: true) controls whether the remend engine runs before block parsing. When enabled, remend closes any uncompleted Markdown syntax — bold, italic, inline code, links, and list items — so that partial tokens render correctly mid-stream.
parseIncompleteMarkdown only takes effect in mode="streaming". In static mode the value is ignored and remend never runs.normalizeHtmlIndentation prop
ThenormalizeHtmlIndentation prop (default: false) strips excess indentation from HTML blocks before they reach the Markdown parser. Without this, indented HTML tags can be misinterpreted as code blocks (Markdown treats 4+ leading spaces as indented code).
This is useful when rendering AI-generated HTML with nested tags indented for readability:
Static mode
Setmode="static" to skip all streaming-specific logic. The entire markdown string is rendered in a single pass without block splitting, transitions, or the remend engine.
- The content is already fully generated (chat history, pre-rendered messages)
- You need a simpler rendering path with lower overhead
- You want to avoid the flash that can occur when transitioning from streaming to done
isAnimating prop
TheisAnimating prop signals whether new tokens are actively arriving. It controls several behaviors:
- Enables or disables the character animation pipeline (when
animatedis set) - Disables copy/download buttons on code blocks and tables to prevent copying incomplete content
- Triggers
onAnimationStart/onAnimationEndcallbacks on transitions - Suppresses the cursor caret when the last block contains an incomplete code fence or table
