Container
A centered wrapper that constrains your email content to a max width in modern clients, with a table fallback for classic Outlook support.
Usage
<template>
<Layout>
<Container>
<Text>Centered, max 600px wide.</Text>
</Container>
</Layout>
</template>
By default, it's 600px and centered. Override with any Tailwind width utility:
<template>
<Container class="max-w-2xl">
<Text>Wider container</Text>
</Container>
</template>
Props
width
Type: string | number
Default: null
Sets the max-width on the <div> and the width on the MSO fallback table. Use this when you'd rather pass a numeric prop than a Tailwind class.
<template>
<Container :width="600">
<Text>Constrained to 600px.</Text>
</Container>
</template>
You may also use a string value like width="600px" or even width="600", it will be correctly parsed and suffixed with px if needed.
msoStyle
Type: string
Default: undefined
Inline CSS applied only to the MSO <td> element. Use for Outlook-specific styling that shouldn't affect other clients.
<template>
<Container mso-style="mso-padding-alt: 0;">
<Text>Padding removed in Outlook only.</Text>
</Container>
</template>
outlookFallback
Type: boolean
Default: true
Toggle Outlook (MSO) and VML fallback markup for this container and its descendants. Set this to false to use modern markup and skip the MSO ghost table, VML shapes, xmlns:v / xmlns:o attributes, and mso-specific CSS.
<template>
<Container :outlook-fallback="false">
<Text>Modern markup only, no MSO fallback.</Text>
</Container>
</template>
Column width inheritance
Container exposes its resolved width to descendant Row / Column / Section components, so you get automatic column width calculation based on the Container's width and the number of columns in a row.
<template>
<Container>
<Row>
<Column>200px wide</Column>
<Column>200px wide</Column>
<Column>200px wide</Column>
</Row>
</Container>
</template>
Same applies when you size the Container with a Tailwind utility:
<template>
<Container class="max-w-xl">
<Row>
<Column>288px</Column>
<Column>288px</Column>
</Row>
</Container>
</template>