HTML
Wraps the email document with a root element
Install
Install the component from your command line
console
pnpm add jsx-emailpnpm add jsx-emailconsole
bun add jsx-emailbun add jsx-emailconsole
npm add jsx-emailnpm add jsx-emailconsole
yarn add jsx-emailyarn add jsx-emailUsage
Add the component to your email template. Include styles where needed.
jsx
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>
);
};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
ts
lang?: string;lang?: string;Identify the language of text content on the email
ts
dir?: string;dir?: string;Identify the direction of text content on the email
ts
enableVML?: boolean;enableVML?: boolean;This is used the xmlns:o and xmlns:v attributes to the html element for maximum VML compatibility Default value is true
TIP
This component also expresses all of the Common Component Props for ComponentProps<'html'>.