npm / streamdown
streamdown
What changed in streamdown 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
streamdown 2114 changes
Breaking changes 6
The code package now requires Node 20 or newer because it moves to Shiki v4.
The codeDownload prop is removed; use the unified controls API instead.
The distributed typings no longer require mermaid as a hard runtime or type dependency.
Streamed incomplete links now remain pending instead of being sanitized into [blocked].
Removes CommonJS builds from the package distribution.
Streamdown switches to a plugin architecture, changing how developers structure or extend integrations.
Security 4
Custom HTML tags can treat children as plain text so user-supplied labels cannot interpret markdown metacharacters as formatting.
Escapes HTML correctly when rehype-raw is not included.
Streamdown adds rehype sanitization for rendered content.
rehype-harden is updated to fix relative URL handling.
New APIs and options 37
Adds a Streamdown prop to disable GFM autolinking for selected URL protocols while leaving explicit markdown links unchanged.
Adds a fallback renderer for standard HTML and allowed custom tags missing from the components map.
Adds a top-level prop for configuring the container used by Mermaid fullscreen, table fullscreen, and the link safety modal.
BundledLanguage, BundledTheme, and ThemeRegistrationAny are locally defined so consumers can type-check without installing shiki.
Adds a maximum height option for code blocks with streaming auto-scroll.
Code, table, and Mermaid downloads can use custom filenames while retaining boolean visibility controls and automatic extensions.
Image controls can disable the hover overlay and download button, independently or together.
Adds configurable CSV separators for table copy and download, including locale-aware auto mode and improved Excel escaping.
Mermaid fullscreen overlays gain a stable selector and dialog semantics with aria-modal for screen-reader correctness.
Adds a maximum height option for tables with streaming auto-scroll.
Adds a prop to disable line numbers in code blocks.
Custom renderers receive the raw metastring from code fences through an optional prop.
Configures animation delay between streaming words or characters; the default is 40ms and zero restores prior behavior.
The components prop now supports an inlineCode renderer for styling inline code independently from fenced code blocks.
Tables can open in a fullscreen overlay with Escape or backdrop-click closing, scroll locking, and retained copy/download controls.
Controls can be globally enabled or disabled, or configured per feature for code, table, and Mermaid interactions.
Text direction can be set to ltr, rtl, or auto, with auto detecting direction from the first strong Unicode character in each block.
The Streamdown component accepts partial custom icon overrides while unspecified icons retain their defaults.
A callback fires when streaming animation completes, allowing UI state to coordinate with the animation lifecycle.
A callback fires when streaming animation begins, allowing UI state to coordinate with the animation lifecycle.
Specific fenced-code languages can be rendered by custom components through plugins.renderers instead of the default CodeBlock.
Generated Tailwind utility classes can receive a namespace prefix to avoid class name collisions with Tailwind v4 prefix().
Code blocks can specify a custom starting line number through fenced-code metadata instead of always starting at 1.
Table controls and data utilities are exported so custom table overrides can preserve copy and download interactivity.
createCodePlugin accepts custom Shiki light and dark themes as bundled names or full theme registration objects.
All user-facing UI strings can be overridden, enabling full internationalization support.
Adds a prop preventing indented HTML tags from being interpreted as code blocks.
Adds a Markdown copy option to TableCopyDropdown, allowing table data to be copied in valid Markdown format.
Adds a hook for detecting incomplete streamed code fences so custom components can defer expensive rendering until code blocks are complete.
Adds built-in animation support through the animated prop.
Adds support for defining custom tags in components.
Extends the ReactMarkdown props accepted by streamdown.
Streamdown adds support for carets in rendered content.
remend can now be configured by developers integrating Streamdown.
Streamdown adds support for using a self-hosted CDN.
A Streamdown CDN is created, with the bundle size reduced by 98%.
A hook enables lazy loading components when they enter the viewport.
Performance 4
Streaming documents reuse parsed blocks and lex only block tokens, improving parsing speed during updates.
Streaming code blocks and tables pin to the bottom once per frame instead of on every update.
Finished code highlighting uses a size-bounded least-recently-used cache, keeping memory bounded during long sessions.
Mermaid rendering uses viewport-based lazy loading so only visible or nearly visible charts render, preventing freezes with many diagrams.
Behavior and default changes 15
Streaming code blocks highlight only newly added lines instead of re-highlighting the whole block on every update.
Streaming Mermaid diagrams render incrementally one at a time so growing diagrams no longer hold up the stream.
Rest props on fenced code elements are now forwarded to the DOM and update when their values change.
Copy and download controls now expose labels and announce copy success to screen readers.
Inline backtick code now receives per-word streaming fade-in while fenced code blocks remain unsplit.
Markdown inside multiline custom tags is parsed and rendered while streaming keeps the entire custom tag as one block.
Code blocks support horizontal scrolling so long lines remain accessible instead of being clipped.
CSV string downloads now prepend a UTF-8 BOM so Excel on Windows detects UTF-8 encoding.
New streaming content animates sequentially with staggered delays instead of all content animating simultaneously.
Code block header action buttons are sticky, keeping copy controls accessible while viewing long code blocks.
Code block shells render immediately with plain text before syntax highlighting resolves, removing the standard spinner fallback and improving visual stability.
Default code blocks expose a data-incomplete attribute while a streamed code fence remains incomplete, enabling CSS loading states.
Redesigns Mermaid diagram rendering.
Redesigns table rendering.
KaTeX CSS is loaded from a CDN.
Fixes and other changes 48
Bare URLs following fullwidth punctuation are linkified again for CJK text.
Incomplete images now show an animated loading placeholder during streaming instead of disappearing.
Mermaid diagrams now auto-fit their container and preserve readable text, while retaining user zoom and pan after initial fitting.
The onCopy callback now works with the default code and Mermaid copy controls.
The onError callback now works with the default code and Mermaid copy controls.
The scanner now follows CommonMark for fences and spans, avoids false emphasis, and makes healing idempotent.
Copied or downloaded table Markdown now preserves literal HTML tags and character entities.
dir="auto" now detects direction per semantic block, keeps code left-to-right, and uses majority direction for mixed-script prose.
Footnote identifiers no longer receive a doubled user-content- prefix, restoring footnote navigation.
Code lines remain separate block elements when line numbers are disabled, preventing visual line collapse.
The link safety modal is portaled to document.body, preventing invalid div-inside-p markup and React hydration errors.
Memoized markdown components now re-render when rendered output changes even if source positions remain identical.
Mermaid download and copy controls now remain reachable inside the fullscreen portal.
Mermaid SVGs are serialized as valid SVG markup so HTML-style tags render correctly in downloads.
Streaming word stagger now uses a shared wall-clock timeline so sibling sections do not overlap during animation.
Table copy preserves line breaks in cells containing br elements across Markdown, CSV, and TSV output.
Copy and download actions now work for fullscreen tables while inline table controls remain unchanged.
The fullscreen table portal now has a stable data attribute so copy and download dropdowns can locate the table.
Completed unchanged code blocks no longer unnecessarily re-render during streaming updates.
Replaces Tailwind v4-only variant syntax with an arbitrary variant compatible with Tailwind CSS v3 and v4.
Replaces Tailwind v4-only variant syntax with an arbitrary variant compatible with Tailwind CSS v3 and v4.
Dropdown menus receive a higher z-index to prevent clipping by surrounding elements.
Empty highlighted code lines preserve whitespace and remain available when copied instead of collapsing into nothing.
Streaming updates no longer retrigger entry animations for already-visible ordered or unordered list characters.
Broken images no longer show a download button and instead display a custom "Image not available" message.
Fixes code block highlight flicker while content is streaming.
Content after an opening custom tag containing double newlines is no longer prematurely split.
Fixes parsing of nested same-tag HTML blocks.
Fixes syntax highlighting behavior for rendered code.
Fixes caret rendering with Tailwind v3.
Removes trailing newlines from rendered code blocks.
Fixes dark code block styling with Tailwind v3.
Restricts footnote matching to valid identifiers so regex character classes in code are not misdetected.
Correctly handles HTML void elements while parsing blocks.
Fixes parsing of single-line indented code blocks.
Fixes rendering of certain LaTeX syntaxes, including parenthesized forms.
Prevents $$ inside code blocks from being treated as math delimiters.
Prevents tables from trapping vertical scrolling.
Allows tel links by default instead of blocking them.
Fixed the Streamdown URL.
Autolink parsing now stops at CJK punctuation boundaries.
Line numbers over 100 no longer wrap onto a new line in code blocks.
Loading languages dynamically is fixed.
Dynamic module imports are fixed.
Pan and zoom controls no longer have layout issues in fullscreen and non-fullscreen modes.
Streamdown attempts to fall back to raw content to prevent cdn-loader from blocking.
Setext heading parsing issues are fixed.
The shouldParseIncompleteMarkdown setting no longer leaks into the DOM.
streamdown 134 changes
Breaking changes 2
defaultUrlTransform was removed and is no longer available to developers.
urlTransform was removed and is no longer available to developers.
New APIs and options 9
Added a global boolean option to toggle Mermaid zoom controls, enabled by default.
Added a per-instance boolean or object option for Mermaid zoom controls.
Custom error components can now be provided for Mermaid diagrams.
Mermaid diagrams can now be exported to SVG and PNG alongside MMD.
A PanZoom component was added, enabling zoom and pan functionality.
Static mode was implemented, adding a new rendering mode developers can use.
Block-level customization hooks were added.
Mermaid diagrams now have a fullscreen view button.
Tables now support copying data as TSV.
Performance 2
Bundle optimization now uses lazy loading and code splitting.
Performance issues with large code streaming blocks were fixed.
Behavior and default changes 5
KaTeX CSS now loads conditionally based on content detection.
parseIncompleteMarkdown is now exported through the public API.
katex.min.css now loads dynamically only when rehypeKatex is included in rehypePlugins.
CJK support was improved through remark-cjk-friendly.
Streamdown contexts were stabilized.
Fixes and other changes 16
Remend was split out into a separate package and updated to remend@1.0.1.
Restores the pan-zoom component to normal size when the mermaid component is maximized.
Added validation for languages specified in code blocks.
Fixed excessive spacing above tables.
Added missing tooltip support to action buttons.
Fixed rendering of p tags inside list items.
Fixes data attributes on rendered code blocks.
Fixed code block rendering in dark mode.
Restores the original lucide imports.
Builds are now targeted for the browser only, fixing ts-router compatibility.
Fixes a bug in markdown parsing.
Incomplete link termination in code blocks was fixed.
List CSS was fixed, improving list rendering.
Base64 image handling was fixed.
Parsing of in-word asterisks was fixed.
CJK support was improved through remark-cjk-friendly-gfm-strikethrough.