Use the slash command menu (type /) to insert more buttons.
`;
export function MyEditor() {
return (
);
}
```
--------------------------------
### Run locally
Source: https://github.com/resend/react-email/blob/canary/apps/docs/getting-started/manual-setup.mdx
Start the development server.
```npm
npm run email:dev
```
```yarn
yarn email:dev
```
```pnpm
pnpm email:dev
```
```bun
bun email:dev
```
--------------------------------
### Quick start example
Source: https://github.com/resend/react-email/blob/canary/apps/docs/editor/features/inspector.mdx
Example showing how to integrate the Inspector with a custom editor setup, rendering Inspector.Root next to the editor content.
```tsx
import { StarterKit } from '@react-email/editor/extensions';
import { EmailTheming } from '@react-email/editor/plugins';
import { Inspector } from '@react-email/editor/ui';
import { EditorContent, EditorContext, useEditor } from '@tiptap/react';
import '@react-email/editor/themes/default.css';
const extensions = [StarterKit, EmailTheming];
export function MyEditor() {
const editor = useEditor({
extensions,
content,
});
return (
);
}
```
--------------------------------
### Install dependencies
Source: https://github.com/resend/react-email/blob/canary/apps/docs/getting-started/manual-setup.mdx
Install the React Email packages locally.
```npm
npm install @react-email/ui -D -E
npm install react-email react react-dom -E
```
```yarn
yarn add @react-email/ui -D -E
yarn add react-email react react-dom -E
```
```pnpm
pnpm add @react-email/ui -D -E
pnpm add react-email react react-dom -E
```
```bun
bun add @react-email/ui -D -E
bun add react-email react react-dom -E
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/section.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Section, Column, Row, Text } from "react-email";
const Email = () => {
return (
{/* A simple `section` */}
Hello World
{/* Formatted with `rows` and `columns` */}
Column 1, Row 1Column 2, Row 1Column 1, Row 2Column 2, Row 2
);
};
```
--------------------------------
### Docs Setup Guide
Source: https://github.com/resend/react-email/blob/canary/apps/docs/contributing.mdx
Commands to set up the documentation development environment.
```sh
git clone https://github.com/resend/react-email.git
```
```sh
pnpm install
```
```sh
cd apps/docs
```
```sh
pnpm dev
```
--------------------------------
### Quick start with EmailEditor
Source: https://github.com/resend/react-email/blob/canary/apps/docs/editor/getting-started.mdx
The recommended way to start is with the standalone `EmailEditor` component. It provides a working editor with default bubble menus, slash commands, theming, and export helpers already wired up.
```tsx
import { EmailEditor } from '@react-email/editor';
const content = `
Welcome
This is the simplest way to use the editor. Try selecting text to see the
bubble menu, or type "/" for slash commands.
`;
export function MyEditor() {
return ;
}
```
--------------------------------
### Installation
Source: https://github.com/resend/react-email/blob/canary/skills/react-email/references/I18N.md
Install next-intl package.
```bash
npm install next-intl
```
--------------------------------
### Install Dependencies and Build
Source: https://github.com/resend/react-email/blob/canary/apps/web/README.md
Commands to install project dependencies and build workspace packages in the root directory.
```bash
pnpm i && pnpm build
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/preview.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Preview } from "react-email";
const Email = () => {
return Email preview text;
};
```
--------------------------------
### Getting Started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/code-block.mdx
Example of how to use the CodeBlock component in an email component.
```jsx
import { CodeBlock, dracula } from 'react-email';
const Email = () => {
const code = `export default async (req, res) => {
try {
const html = await renderAsync(
EmailTemplate({ firstName: 'John' })
);
return NextResponse.json({ html });
} catch (error) {
return NextResponse.json({ error });
}
}`;
return ();
};
```
--------------------------------
### Run the development server
Source: https://github.com/resend/react-email/blob/canary/apps/docs/getting-started/automatic-setup.mdx
Start the local development server to preview email templates.
```sh
npm run dev
```
```sh
yarn dev
```
```sh
pnpm dev
```
```sh
bun dev
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/heading.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Heading } from "react-email";
const Email = () => {
return Lorem ipsum;
};
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/README.md
Example of defining an email template with React components.
```jsx
import { Button } from "react-email";
export default function Email() {
return (
);
};
```
--------------------------------
### Installation
Source: https://github.com/resend/react-email/blob/canary/skills/react-email/references/I18N.md
Install react-intl package.
```bash
npm install react-intl
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/packages/create-email/readme.md
Command to initialize a new React Email project.
```sh
npx create-email
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/html.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Html, Button } from "react-email";
const Email = () => {
return (
);
};
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/text.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Text } from "react-email";
const Email = () => {
return Lorem ipsum;
};
```
--------------------------------
### Quick start
Source: https://github.com/resend/react-email/blob/canary/apps/docs/editor/features/column-layouts.mdx
Example showing how to include column extensions using StarterKit and EditorProvider.
```tsx
import { StarterKit } from '@react-email/editor/extensions';
import { EditorProvider } from '@tiptap/react';
const extensions = [StarterKit];
export function MyEditor() {
return ;
}
```
--------------------------------
### Image Usage Examples
Source: https://github.com/resend/react-email/blob/canary/skills/react-email/references/STYLING.md
Examples demonstrating how to use the `Img` component for meaningful and decorative images, including `alt` text and responsive sizing.
```tsx
{/* Meaningful image — describe purpose and details */}
{/* Decorative image — always pass an empty alt string so screen readers skip it */}
```
--------------------------------
### Install project dependencies
Source: https://github.com/resend/react-email/blob/canary/apps/docs/getting-started/automatic-setup.mdx
Install the necessary dependencies for the new React Email project.
```sh
npm install
```
```sh
yarn
```
```sh
pnpm install
```
```sh
bun install
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/link.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Link } from "react-email";
const Email = () => {
return Example;
};
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/image.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Img } from "react-email";
const Email = () => {
return ;
};
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/markdown.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Markdown, Html } from "react-email";
const Email = () => {
return (
{`# Hello, World!`}
{/* OR */}
);
};
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/column.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Column, Row } from "react-email";
const Email = () => {
return (
ABC
);
};
```
--------------------------------
### Install react-i18next dependencies
Source: https://github.com/resend/react-email/blob/canary/skills/react-email/references/I18N.md
Command to install react-i18next, i18next, and i18next-resources-to-backend.
```bash
npm install react-i18next i18next i18next-resources-to-backend
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/head.mdx
Add the component to your email template. Include children tags where needed.
```jsx
import { Head } from "react-email";
const Email = () => {
return (
My email title
);
};
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/row.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Row, Column, Section } from "react-email";
const Email = () => {
return (
ABC
);
};
```
--------------------------------
### Adding a BubbleMenu to EditorProvider
Source: https://github.com/resend/react-email/blob/canary/apps/docs/editor/getting-started.mdx
Example of adding a floating formatting toolbar (`BubbleMenu`) as a child of `EditorProvider` to enable text formatting when selecting text.
```tsx
import { StarterKit } from '@react-email/editor/extensions';
import { BubbleMenu } from '@react-email/editor/ui';
import { EditorProvider } from '@tiptap/react';
import '@react-email/editor/themes/default.css';
const extensions = [StarterKit];
const content = `
Select this text to see the bubble menu. Try bold,
italic, and other formatting options.
`;
export function MyEditor() {
return (
);
}
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/button.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Button } from "react-email";
const Email = () => {
return (
);
};
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/container.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Container, Button } from "react-email";
const Email = () => {
return (
);
};
```
--------------------------------
### Getting started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/hr.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { Hr } from "react-email";
const Email = () => {
return ;
};
```
--------------------------------
### Getting Started
Source: https://github.com/resend/react-email/blob/canary/apps/docs/components/code-inline.mdx
Add the component to your email template. Include styles where needed.
```jsx
import { CodeInline } from "react-email";
const Email = () => {
return @react-email/code-inline;
}
```
--------------------------------
### Minimal Setup (Extensions Only)
Source: https://github.com/resend/react-email/blob/canary/skills/react-email/references/EDITOR.md
Example of using EditorProvider with StarterKit for more control.
```tsx
import { StarterKit } from '@react-email/editor/extensions';
import { EditorProvider } from '@tiptap/react';
const extensions = [StarterKit];
const content = {
type: 'doc',
content: [
{
type: 'paragraph',
content: [{ type: 'text', text: 'Start typing or edit this text.' }],
},
],
};
export function MyEditor() {
return ;
}
```
--------------------------------
### Install React Email automatically
Source: https://github.com/resend/react-email/blob/canary/apps/docs/getting-started/automatic-setup.mdx
Use `create-email` to automatically set up React Email with a starter project.
```sh
npx create-email@latest
```
```sh
yarn create email
```
```sh
pnpm create email
```
```sh
bun create email
```
--------------------------------
### Quick start
Source: https://github.com/resend/react-email/blob/canary/apps/docs/editor/features/image-upload.mdx
Example demonstrating how to import and use `useEditorImage`, add the extension, register `imageSlashCommand`, and render `BubbleMenu.ImageDefault` for inline editing.
```tsx
import { StarterKit } from '@react-email/editor/extensions';
import { imageSlashCommand, useEditorImage } from '@react-email/editor/plugins';
import {
BubbleMenu,
defaultSlashCommands,
SlashCommand,
} from '@react-email/editor/ui';
import { EditorProvider } from '@tiptap/react';
import { useCallback } from 'react';
import '@react-email/editor/themes/default.css';
export function MyEditor() {
const uploadImage = useCallback(async (file: File) => {
const url = await uploadToStorage(file);
return { url };
}, []);
const imageExtension = useEditorImage({ uploadImage });
return (
);
}
```
--------------------------------
### Multi-Column Layout
Source: https://github.com/resend/react-email/blob/canary/skills/react-email/references/STYLING.md
Example of creating a multi-column layout using `Row` and `Column` components.
```tsx
Left contentRight content
```
--------------------------------
### Quick start
Source: https://github.com/resend/react-email/blob/canary/apps/docs/editor/features/link-editing.mdx
Example demonstrating how to add an inline link editing toolbar using `BubbleMenu.LinkDefault`.
```tsx
import { StarterKit } from '@react-email/editor/extensions';
import { BubbleMenu } from '@react-email/editor/ui';
import { EditorProvider } from '@tiptap/react';
import '@react-email/editor/themes/default.css';
const extensions = [StarterKit];
const content = `
);
};
Email.PreviewProps = {
source: "https://example.com",
};
```
--------------------------------
### Base Email Template
Source: https://github.com/resend/react-email/blob/canary/apps/docs/guides/internationalization/react-i18next.mdx
An example React Email template before internationalization, used as a base for the guide.
```jsx
export default function WelcomeEmail({ name }) {
return (