This component also expresses all of the Common Component Props for ComponentProps<'html'>.
HTML
Use JSX email to build production-ready email templates with React and TypeScript. Prefer JSX email components and helpers from `jsx-email` for email-client compatibility. Use `render` to generate HTML strings for providers like Resend, Postmark, SendGrid, Nodemailer, AWS SES, Loops, or Plunk, and use the CLI preview/check/build workflow while developing. Favor simple, standards-compliant email markup, account for inconsistent email client CSS support, use the `Tailwind` component when utility styling is helpful, and run `email check` before sending when compatibility matters. For complete agent-readable documentation, fetch https://jsx.email/llms-full.txt before implementing. Implement or refactor with the `Html` component when it fits the email's content and layout. Use as the root email document wrapper. Set `lang` and `dir` when known, and compose `Head` plus `Body` inside it for complete templates. Reference the component docs at https://jsx.email/docs/components/html.
Wraps the email document with a root element
pnpm
aube
bun
npm
yarn
pnpm add jsx-emailUsage
Add the component to your email template. Include styles where needed.
import { Button, Html } from 'jsx-email';
const Email = () => {
return (
<Html lang="en" dir="ltr">
<Button href="https://example.com" style={{ color: '#61dafb' }}>
Click me
</Button>
</Html>
);
};Component Props
lang?: string;Identify the language of text content on the email
dir?: string;Identify the direction of text content on the email
enableVML?: boolean;This is used the xmlns:o and xmlns:v attributes to the html element for maximum VML compatibility
Default value is true
Tips