Convert Markdown to valid React Email template code.
npm install @react-email/markdownInstall component from your command line.
#### With yarn
``sh`
yarn add @react-email/markdown -E
#### With npm
`sh`
npm install @react-email/markdown -E
Add the component around your email body content.
`jsx
import { Markdown } from "@react-email/markdown";
import { Html } from "@react-email/html";
const Email = () => {
return (
h1: { color: "red" },
h2: { color: "blue" },
codeInline: { background: "grey" },
}}
markdownContainerStyles={{
padding: "12px",
border: "solid 1px black",
}}
>{# Hello, World!}
{/ OR /}
} />`
);
- Type: string
Contains the markdown content that will be rendered in the email template.
- Type: object
- Default: {}
Provide custom styles for the corresponding HTML element (e.g., p, h1, h2, etc.).
- Type: object
- Default: {}
Provide custom styles for the containing div` that wraps the markdown content.
This component was tested using the most popular email clients.
| |
|
|
|
|
|
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
MIT License