Head
A JSX email component which creates an HTML head element
TIP
This component is required VML in outlook compatibility for adding elements such as <style> and meta directly to the document
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 children tags where needed.
jsx
import { Head } from 'jsx-email';
const Email = () => {
return (
<Head>
<title>My email title</title>
</Head>
);
};import { Head } from 'jsx-email';
const Email = () => {
return (
<Head>
<title>My email title</title>
</Head>
);
};Component Props
tsx
export interface HeadProps extends BaseProps<'head'> {
enableFormatDetection?: boolean;
}export interface HeadProps extends BaseProps<'head'> {
enableFormatDetection?: boolean;
}tsx
enableFormatDetection?: boolean;enableFormatDetection?: boolean;This is used to disable the format-detection meta (will be useful for some very specific use-cases) Default value is false
TIP
This component expresses all of the Common Component Props for ComponentProps<'head'>.