<Streamdown> component. This page documents every available prop, its type, default value, and what it controls.
Core props
The Markdown string to render. In
mode="streaming" this value is expected to grow on each render as new tokens arrive.Controls how Streamdown renders content.
"streaming"— parses the content into independent blocks and memoizes each one so only the last block re-renders as new tokens arrive. All streaming features (incomplete-markdown handling, carets, animation) are active."static"— renders the entire string as a single pass. Use this when the content is already complete (e.g. cached AI responses, documentation pages). Callbacks likeonAnimationStartandonAnimationEndare suppressed in this mode.
Signals that content is actively being streamed. When
true:- The caret indicator is visible (if
caretis set) - Copy/download buttons on code blocks and tables are disabled
- The character-by-character animate plugin is active (if
animatedis set) onAnimationStartfires on the transition fromfalse→true
When
true (the default), Streamdown runs the remend preprocessor on the raw markdown string before parsing. Remend closes open formatting spans (bold, italic, inline code, links, etc.) and handles other incomplete constructs that a mid-stream token boundary can produce.Disable this only if you are streaming pre-validated complete markdown or if you are providing your own preprocessing.Removes leading indentation (4+ spaces) from lines that begin with an HTML tag. This prevents the Markdown parser from treating indented HTML blocks as fenced code blocks.Useful when rendering AI-generated responses that include well-indented HTML with deeply nested tags.
Text direction applied to rendered blocks.
"ltr"/"rtl"— forces a fixed direction for all blocks."auto"— detects the direction of each individual block using the Unicode first strong character algorithm. This is the right choice for multilingual chat applications where different messages may be in different languages.
Additional CSS class names added to the outermost
<div> container. Useful for scoping styles or integrating with utility-class frameworks.If a prefix is also set, the class names you provide here are prefixed the same as Streamdown’s internal classes.Streaming & incomplete markdown
Fine-grained control over which incomplete-markdown completions the remend preprocessor applies. All options default to
true. Pass false to disable a specific completion.| Key | Default | Description |
|---|---|---|
links | true | Complete incomplete links |
images | true | Complete incomplete images |
bold | true | Close open ** bold spans |
italic | true | Close open * / _ italic spans |
boldItalic | true | Close open *** bold-italic spans |
inlineCode | true | Close open ` inline code |
strikethrough | true | Close open ~~ strikethrough spans |
katex | true | Close open $$ math blocks |
setextHeadings | true | Handle incomplete setext headings |
comparisonOperators | true | Escape > in list items that look like blockquotes |
htmlTags | true | Strip incomplete HTML tags at end of text |
linkMode | "protocol" | "protocol" uses a placeholder URL; "text-only" renders plain text |
handlers | — | Array of custom RemendHandler functions |
Styling props
A
[lightTheme, darkTheme] tuple passed to Shiki for syntax highlighting code blocks. Accepts any bundled theme name (BundledTheme) or a custom theme registration object (ThemeRegistrationAny).An object mapping HTML element names to custom React components. When you supply a component, it fully replaces the default renderer — including its built-in Tailwind classes.See the Components page for a full guide and the list of overridable elements. The special key
inlineCode overrides only inline code without replacing the block code renderer.A Tailwind CSS class prefix prepended to every utility class Streamdown generates internally. Set this to match the value passed to Tailwind v4’s
prefix() function.User-supplied className values are also prefixed, so you must not prefix them yourself.Custom HTML tags
A map of custom HTML tag names to their allowed attribute names. Tags not listed here are stripped by the sanitizer (content is preserved, the tag element is removed).This prop only takes effect when you are using the default rehype plugins.
Tag names whose child content should be treated as plain text instead of parsed as Markdown. This prevents underscores, asterisks, and other Markdown metacharacters inside tag content from being formatted.Every tag listed here must also appear in
allowedTags.Feature props
Displays a cursor character at the end of the last rendered element while
isAnimating is true. See the Carets page for full details.Enables character-by-character reveal animation for newly arrived tokens during streaming. Pass
true for default settings or an AnimateOptions object to customize the animation.See the Animation page for full configuration.Controls visibility of the interactive buttons rendered on code blocks, tables, and Mermaid diagrams. Accepts
true (show all), false (hide all), or a granular config object:Show line numbers in fenced code blocks. Can be overridden per block by adding
noLineNumbers to the code fence meta string:Configure the link-safety modal that appears before navigating to external URLs. See the Link Safety page for details.
Options for Mermaid diagram rendering.
A Mermaid configuration object passed directly to the Mermaid renderer.
A custom component rendered when a Mermaid diagram fails to parse or render. Receives
{ chart, error, retry } props.Plugin bundles for optional heavy features: math rendering, CJK text support, and custom code highlighters. See the Plugins section for setup guides.
Internationalization & icons
Override any of the built-in English UI labels used in copy buttons, download menus, and link modals. Any key you omit falls back to the English default. See the Internationalization page for all keys.
Override the SVG icon components used in controls. Any key you omit keeps the default icon. See the Internationalization page for the full
IconMap interface.Lifecycle callbacks
Called when
isAnimating transitions from false to true. Suppressed in mode="static". Wrap in useCallback to prevent unnecessary re-renders.Called when
isAnimating transitions from true to false. Suppressed in mode="static". Wrap in useCallback to prevent unnecessary re-renders.Advanced props
Replaces the internal component used to render each individual block. A block is one top-level Markdown section as returned by
parseMarkdownIntoBlocksFn.Use this to wrap blocks with additional context providers or measurement logic without affecting the Markdown rendering pipeline.Replaces the function that splits the full Markdown string into independent blocks before memoized rendering. The default implementation splits on blank lines between top-level elements.Providing a custom function lets you control block granularity (e.g. splitting on headings, or treating the whole string as a single block).
The rehype plugin pipeline applied to each block’s HAST. The default pipeline includes
rehype-raw, rehype-sanitize, and rehype-harden.Replace the entire array to use a fully custom pipeline. If you replace the default plugins, allowedTags will no longer work automatically — you must configure your sanitizer manually.The remark plugin pipeline applied to Markdown before it is converted to HAST. The default pipeline includes
remark-gfm and an internal remarkCodeMeta plugin.Element filtering
These props match the react-markdown API, making Streamdown a drop-in replacement.An allowlist of HTML tag names. All other elements are removed from the output. Cannot be combined with
disallowedElements.A blocklist of HTML tag names to remove from the output. Cannot be combined with
allowedElements.A custom filter function called for each element in the tree. Return
false to remove the element. Applied after allowedElements / disallowedElements.When
true, disallowed elements are replaced by their children instead of being removed entirely. Useful for stripping wrapper tags while keeping their content.Ignore raw HTML in the Markdown source entirely.
urlTransform
(url: string, key: string, node: Element) => string | null | undefined
default:"defaultUrlTransform"
Transform every URL that appears in the Markdown (links, images, etc.). Return an empty string to remove the URL. URL security is handled separately by
rehype-sanitize and rehype-harden.