mirror of
https://github.com/resend/react-email.git
synced 2026-09-14 14:18:02 +08:00
50 lines
815 B
Plaintext
50 lines
815 B
Plaintext
---
|
|
title: "Container"
|
|
sidebarTitle: "Container"
|
|
description: "A layout component that centers your content horizontally on a breaking point."
|
|
"og:image": "https://react.email/static/covers/container.png"
|
|
icon: "grid"
|
|
---
|
|
|
|
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 { Container, Button } from "react-email";
|
|
|
|
const Email = () => {
|
|
return (
|
|
<Container>
|
|
<Button href="https://example.com" style={{ color: "#61dafb" }}>
|
|
Click me
|
|
</Button>
|
|
</Container>
|
|
);
|
|
};
|
|
```
|
|
|
|
<Support/>
|