mirror of
https://github.com/resend/react-email.git
synced 2026-09-14 14:18:02 +08:00
65 lines
1.2 KiB
Plaintext
65 lines
1.2 KiB
Plaintext
---
|
|
title: "HTML"
|
|
sidebarTitle: "HTML"
|
|
description: "A React html component to wrap emails."
|
|
"og:image": "https://react.email/static/covers/html.png"
|
|
icon: "file-code"
|
|
---
|
|
|
|
import Support from '/snippets/support.mdx'
|
|
|
|
## Install
|
|
|
|
Install component from your command line.
|
|
|
|
<CodeGroup>
|
|
|
|
```sh npm
|
|
npm install react-email -E
|
|
```
|
|
|
|
```sh yarn
|
|
yarn add react-email -E
|
|
```
|
|
|
|
```sh pnpm
|
|
pnpm add react-email -E
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
## Getting started
|
|
|
|
Add the component to your email template. Include styles where needed.
|
|
|
|
```jsx
|
|
import { Html, Button } from "react-email";
|
|
|
|
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>
|
|
|
|
<Info>
|
|
These values apply only to the `html` tag — they are not passed down to
|
|
[`Body`](/components/body), which has its own `lang` and `dir` defaults. For
|
|
non-English or right-to-left emails, set the same values on `Body` too.
|
|
</Info>
|
|
|
|
<Support/>
|