React Email Markdown
Det här innehållet är inte tillgängligt på ditt språk än.
Install
Install component from your command line.
npm install @react-email/components -E# or get the individual packagenpm install @react-email/markdown -E
yarn add @react-email/components -E# or get the individual packageyarn add @react-email/markdown -E
pnpm add @react-email/components -E# or get the individual packagepnpm add @react-email/markdown -E
Getting Started
Add the component to your email template. Include styles where needed.
import { Markdown, Html } from "@react-email/components";
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
Param | Type | Default Value | Remark |
---|---|---|---|
children | string | Contains the markdown content that will be rendered in the email template | |
markdownContainerStyles | object | {} | Provide custom styles for the containing div that wraps the markdown content |
markdownCustomStyles | object | {} | Provide custom styles for the corresponding html element (p, h1, h2, etc.) |