Layout
A convenience that combines <Html>, <Head>, and <Body> into a single wrapper, with Tailwind CSS and Inter font included by default.
Usage
<template>
<Layout>
<Container>
<Text>Hello!</Text>
</Container>
</Layout>
</template>
This renders a complete email document structure: <html> with VML namespaces, <head> with meta tags, Tailwind CSS and the Inter font from Google Fonts, as well as <body> with an accessible role="article" wrapper.
Layout is ideal for projects where all emails share the same document structure.
Props
bodyClass
Type: string
Default: ''
CSS classes to apply to the <body> element.
<Layout body-class="bg-slate-100">
<!-- content -->
</Layout>
lang
Type: string
Default: 'en'
Sets the lang attribute on the <html> element, and the xml:lang attribute on <body>.
<template>
<Layout lang="de">
<!-- German email content -->
</Layout>
</template>
dir
Type: 'ltr' | 'rtl'
Default: 'ltr'
Sets the text direction on the <html> element.
<template>
<Layout lang="ar" dir="rtl">
<!-- right-to-left content -->
</Layout>
</template>
ariaLabel
Type: string
Default: undefined
Sets the aria-label attribute on the wrapper <div> inside <body>.
<template>
<Layout aria-label="Welcome email">
<!-- content -->
</Layout>
</template>
What's included
Layout renders these elements for you:
<html>withlang,dir, and VML namespace attributes<head>with essential meta tags (charset, viewport, format-detection)- MSO-specific styles for font rendering
- Google Fonts preconnect links and Inter font import
- Tailwind CSS import
<body>with an accessiblediv[role="article"]wrapper
When to use it
Layout is opinionated syntax sugar provided as convenience — it includes Google Fonts (Inter), MSO font styles, and a specific set of meta tags. It's what we recommend using unless you know what you're doing.
If you need full control over what goes in the <head> or want to use different fonts and meta tags, use the <Html>, <Head>, and <Body> components separately.