Use the MarkdownPreview component
masterThe MarkdownPreview component is the primary entrypoint for rendering markdown with preview capabilities. It is a forward-ref component that accepts MarkdownPreviewProps and allows you to customize the rendering pipeline via rehypePlugins.
By default, it includes several plugins to handle raw HTML, metadata retrieval, and syntax highlighting via rehype-prism-plus. You can extend this behavior by providing your own plugins through the rehypePlugins prop.
import MarkdownPreview from '@uiw/react-markdown-preview';
function MyComponent() {
return (
<MarkdownPreview
codeEditable={true}
rehypePlugins={[]} // Add custom rehype plugins here
/>
);
}