Description
react-markdown is a React component that renders Markdown as React elements. You pass it a Markdown string and it returns the page content, without using dangerouslySetInnerHTML, so it is safe by default against cross-site scripting. You can supply your own components to replace the default output for elements such as headings, and you can add plugins from the remark and rehype ecosystems to extend it, for example for syntax highlighting or math. The README says it is 100 percent CommonMark compliant, and it reaches GitHub Flavored Markdown with a plugin. The README covers installation, usage, the API with its Markdown, MarkdownAsync and MarkdownHooks components, examples such as using a plugin with options, and sections on compatibility, architecture and HTML in Markdown. It is a UI library for developers who need Markdown rendering in a React app, and the source and build badges are on the GitHub page of the remarkjs organisation.…
Highlights
- Renders Markdown as React components
- Safe by default, with no dangerouslySetInnerHTML
- Custom components for each element
- Remark and rehype plugins
- CommonMark compliant, GFM with a plugin
Ratings & Reviews
No ratings yet
Be the first to rate react-markdown.
People also visit
react-markdown FAQ
What is react-markdown?
It is a React component that renders a Markdown string as React elements.
Is it safe to render user Markdown?
The README says it is safe by default, because it does not use dangerouslySetInnerHTML or allow XSS attacks.
Can I use GitHub Flavored Markdown?
Yes. The README says it is 100 percent CommonMark compliant and reaches GFM with a plugin.
How do I extend it?
Use plugins from the remark and rehype ecosystems, such as math or syntax highlighting, and pass your own components to replace default elements.
What are the best react-markdown alternatives?
Popular alternatives to react-markdown include react-markdown, react-highlight and interweave. See all react-markdown alternatives















