💡 摘要
一个用于构建现代化、响应式且跨客户端兼容的电子邮件模板的 React 组件库。
🎯 适合人群
🤖 AI 吐槽: “它终于将 React 带入了电子邮件开发领域,一个自互联网诞生以来就由 `<table>` 标签用铁腕统治的地方。”
主要风险是依赖供应链,因为该库是电子邮件生成的基础组件。缓解措施:固定包版本并使用锁文件。从 README 中未推断出直接的 shell 执行、网络访问或文件系统风险,但应对生成的 HTML/电子邮件内容进行清理,以防止最终电子邮件中的注入攻击。

Introduction
A collection of high-quality, unstyled components for creating beautiful emails using React and TypeScript. It reduces the pain of coding responsive emails with dark mode support. It also takes care of inconsistencies between Gmail, Outlook, and other email clients for you.
Why
We believe that email is an extremely important medium for people to communicate. However, we need to stop developing emails like 2010, and rethink how email can be done in 2025 and beyond. Email development needs a revamp. A renovation. Modernized for the way we build web apps today.
Install
Install one of the components from your command line.
With yarn
yarn add @react-email/components -E
With npm
npm install @react-email/components -E
With pnpm
pnpm install @react-email/components -E
Getting started
Add the component to your email template. Include styles where needed.
import { Button } from "@react-email/components"; const Email = () => { return ( <Button href="https://example.com" style={{ color: "#61dafb" }}> Click me </Button> ); };
Components
A set of standard components to help you build amazing emails without having to deal with the mess of creating table-based layouts and maintaining archaic markup.
- Body
- Button
- CodeBlock
- CodeInline
- Column
- Container
- Divider
- Font
- Head
- Heading
- Html
- Image
- Link
- Markdown
- Paragraph
- Preview
- Section
Integrations
Emails built with React Email can be converted into HTML and sent using any email service provider. Here are some examples:
Support
All components were tested using the most popular email clients.
| | | | | | | | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
Development workflow
Contributing
Authors
- Bu Kinoshita (@bukinoshita)
- Zeno Rocha (@zenorocha)
License
MIT License
优点
- 提供预构建、经过测试的组件,抽象掉了电子邮件 HTML/CSS 的怪异之处。
- 支持 TypeScript 和现代 React 开发工作流。
- 提供与主要电子邮件服务提供商(Resend、SendGrid 等)的集成。
- 声称与主要电子邮件客户端(Gmail、Outlook 等)兼容。
缺点
- 局限于 React/JSX 范式;不适用于其他技术栈。
- 为简单的电子邮件增加了构建步骤和依赖开销。
- 依赖库的抽象,这可能限制对电子邮件 HTML 的低级控制。
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 resend.
