Skip to content

Component Overrides

Mayank edited this page Jun 22, 2025 · 1 revision

🎨 Component Overrides

Customize rendering of HTML tags:

import { Md, Unwrap, Omit } from "@m2d/react-markdown";

<Md
  components={{
    em: Unwrap,           // Keep children, ignore <em> tag
    blockquote: Omit,     // Remove element entirely
    code: MyCustomCode,
  }}>
  {`*This will be unwrapped*\n\n> This will be removed`}
</Md>

Built-in helpers

  • Unwrap: renders children only
  • Omit: removes the element and its children

Clone this wiki locally