@react-email/markdown
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

React Email Markdown cover

@react-email/markdown
Convert Markdown to valid React Email template code.

Install

Install component from your command line.

With yarn

yarn add @react-email/markdown -E

With npm

npm install @react-email/markdown -E

Getting started

Add the component around your email body content.

import { Markdown } from "@react-email/markdown";
import { Html } from "@react-email/html";

const Email = () => {
  return (
    <Html lang="en" dir="ltr">
      <Markdown
        markdownCustomStyles={{
          h1: { color: "red" },
          h2: { color: "blue" },
          codeInline: { background: "grey" },
        }}
        markdownContainerStyles={{
          padding: "12px",
          border: "solid 1px black",
        }}
      >{`# Hello, World!`}</Markdown>

      {/* OR */}

      <Markdown children={`# This is a ~~strikethrough~~`} />
    </Html>
  );

Props

children field

  • Type: string

Contains the markdown content that will be rendered in the email template.

markdownCustomStyles field

  • Type: object
  • Default: {}

Provide custom styles for the corresponding HTML element (e.g., p, h1, h2, etc.).

markdownContainerStyles field

  • Type: object
  • Default: {}

Provide custom styles for the containing div that wraps the markdown content.

Support

This component was tested using the most popular email clients.

Gmail logo Apple Mail Outlook logo Yahoo! Mail logo HEY logo Superhuman logo
Gmail ✔ Apple Mail ✔ Outlook ✔ Yahoo! Mail ✔ HEY ✔ Superhuman ✔

License

MIT License

Readme

Keywords

Package Sidebar

Install

npm i @react-email/markdown

Weekly Downloads

123,550

Version

0.0.9

License

MIT

Unpacked Size

11.8 kB

Total Files

7

Last publish

Collaborators

  • gabrielmfern
  • bukinoshita
  • zenorocha