react-markdown. The props API is 100% compatible — children, components, remarkPlugins, rehypePlugins, remarkRehypeOptions, allowElement, allowedElements, disallowedElements, skipHtml, unwrapDisallowed, and urlTransform all work without changes.
Beyond compatibility, switching to Streamdown removes a significant amount of boilerplate: built-in GFM, syntax highlighting, math, mermaid diagrams, prestyled typography, and internal memoization are all included.
What changes
Package name and import
react-markdown:
Tailwind CSS source path
Streamdown requires Tailwind to scan its built output. Add a@source directive to your globals.css:
globals.css
content array in tailwind.config.js:
tailwind.config.js
What you can remove
Streamdown bundles several plugins and components that were previously installed separately.Built-in plugins
The following packages are built into Streamdown. You can uninstall them:rehype-hardenrehype-katexrehype-rawremark-cjk-friendlyremark-cjk-friendly-gfm-strikethroughremark-gfmremark-math
Custom code block and mermaid components
Streamdown renders syntax-highlighted code blocks and Mermaid diagrams natively. Any customcode or mermaid component overrides in your ReactMarkdown usage can be deleted. This may also let you uninstall shiki or react-syntax-highlighter from package.json.
Custom element overrides for basic elements
Streamdown prestyles all standard HTML elements (p, li, h1–h6, blockquote, table, etc.). If your existing ReactMarkdown usage passes components only to style these basic elements, you can remove those overrides entirely.
Similarly, if the wrapper component uses Tailwind’s prose classes for typography, those can be removed.
Memoization wrappers
Streamdown handles memoization internally usingReact.memo and per-block memoization in streaming mode. If your codebase has a MemoizedReactMarkdown wrapper (or equivalent), remove it and use Streamdown directly.
What stays the same
Allreact-markdown props continue to work without modification:
| Prop | Type | Description |
|---|---|---|
children | string | The markdown content to render |
components | Components | Custom component overrides |
remarkPlugins | Pluggable[] | Remark plugins for markdown processing |
rehypePlugins | Pluggable[] | Rehype plugins for HTML processing |
remarkRehypeOptions | object | Options passed to remark-rehype |
allowedElements | string[] | Only render these HTML elements |
disallowedElements | string[] | Remove these HTML elements |
allowElement | function | Custom filter per element |
unwrapDisallowed | boolean | Keep children of disallowed elements |
skipHtml | boolean | Ignore raw HTML in markdown |
urlTransform | function | Transform all URLs |
Step-by-step migration
Remove built-in plugins
Uninstall any of these packages if you installed them only for Remove the corresponding
ReactMarkdown:import statements and remarkPlugins/rehypePlugins arrays from your markdown component.Remove custom code block and mermaid components
Delete any custom components you passed as
components.code for syntax highlighting or mermaid rendering. Streamdown handles both natively.If you were using shiki or react-syntax-highlighter only for this purpose, uninstall them:Remove custom element overrides for basic elements
If your
components prop only overrides basic typographic elements (p, li, h1, etc.) for styling, delete those overrides. Streamdown prestyles them.Remove any prose Tailwind classes from the parent container.Remove memoization wrappers
Delete any
MemoizedReactMarkdown component or equivalent React.memo wrapper. Import and use Streamdown directly at the call sites.Configure Tailwind CSS
Add the Adjust the relative path based on your project structure. See Getting started for monorepo instructions.
@source directive so Tailwind picks up Streamdown’s utility classes:globals.css
