Skip to content

HTML

Wraps the email document with a root element

Install

Install the component from your command line

console
pnpm install email-craft
pnpm install email-craft
console
bun install email-craft
bun install email-craft
console
npm install email-craft
npm install email-craft
console
yarn install email-craft
yarn install email-craft

Usage

Add the component to your email template. Include styles where needed.

jsx
import { Button, Html } from 'email-craft';

const Email = () => {
  return (
    <Html lang="en" dir="ltr">
      <Button href="https://example.com" style={{ color: '#61dafb' }}>
        Click me
      </Button>
    </Html>
  );
};
import { Button, Html } from 'email-craft';

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

TIP

This component also expresses all of the Common Component Props for ComponentProps<'html'>.