Back to React Email

HTML

apps/docs/components/html.mdx

0.0.151.1 KB
Original Source

import Support from '/snippets/support.mdx'

Install

Install component from your command line.

<CodeGroup>
sh
npm install @react-email/components -E

# or get the individual package

npm install @react-email/html -E
sh
yarn add @react-email/components -E

# or get the individual package

yarn add @react-email/html -E
sh
pnpm add @react-email/components -E

# or get the individual package

pnpm add @react-email/html -E
</CodeGroup>

Getting started

Add the component to your email template. Include styles where needed.

jsx
import { Html, Button } from "@react-email/components";

const Email = () => {
  return (
    <Html lang="en" dir="ltr">
      <Button href="https://example.com" style={{ color: "#61dafb" }}>
        Click me
      </Button>
    </Html>
  );
};

Props

<ResponseField name="lang" type="string" default="en"> Identify the language of text content on the email </ResponseField> <ResponseField name="dir" type="string" default="ltr"> Identify the direction of text content on the email </ResponseField> <Support/>