framix-team/skill-email-html-mjml / email-html-mjml
email-html-mjml
VerifiedResponsive HTML email template generation using MJML 5.x framework. Use when the user asks to create, generate, design, or build an email template — including welcome emails, promotional blasts, transactional templates, newsletters, or any responsive email. Also use when the user asks to compile MJML to HTML, work with or edit existing MJML templates or `.mjml` files, or troubleshoot email rendering issues across clients.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 1.0 KB |
| SKILL.md | skill md | 10.6 KB |
| assets/examples/basic-layout.mjml | other | 3.7 KB |
| assets/examples/newsletter.mjml | other | 5.0 KB |
| assets/examples/order-confirmation.mjml | other | 4.1 KB |
| assets/examples/partials/footer.mjml | other | 742 B |
| assets/examples/promo-sale.mjml | other | 5.6 KB |
| compilation.md | markdown | 5.2 KB |
| components/advanced.md | markdown | 6.0 KB |
| components/content.md | markdown | 5.1 KB |
| components/head.md | markdown | 3.2 KB |
| components/interactive.md | markdown | 8.0 KB |
| components/layout.md | markdown | 4.8 KB |
| mjml-reference.md | markdown | 8.5 KB |
components/layout.md
View on GitHub# MJML Layout Components Reference
## Document Hierarchy
```
mjml
├── mj-head
└── mj-body
├── mj-wrapper (optional grouping)
│ └── mj-section
├── mj-section (row)
│ ├── mj-column (or mj-group)
│ │ └── [content components]
│ └── mj-group
│ └── mj-column
└── mj-hero (special banner section)
```
**Hard rules:**
- `mj-section` and `mj-column` cannot be nested inside another `mj-column`
- Every content component inside a column inherits 100% of the column width
- Default email width: 600px (set on `mj-body`)
---
## Root `<mjml>` tag
| Attribute | Accepts | Default | Notes |
|-----------|---------|---------|-------|
| lang | string | "und" | Sets `lang` attribute on `<html>` and body `<div>`. Use for accessibility + RTL support. e.g. `lang="en"` |
| dir | ltr / rtl | auto | Text direction |
| owa | "desktop" | none | Forces desktop view for old self-hosted Outlook.com (rare) |
```xml
<mjml lang="en" dir="ltr">
```
---
## mj-body
| Attribute | Accepts | Default |
|-----------|---------|---------|
| background-color | CSS color | — |
| width | px | 600px |
| css-class | string | — |
---
## mj-section
A horizontal row. Contains `mj-column` or `mj-group` children.
| Attribute | Accepts | Default |
|-----------|---------|---------|
| background-color | CSS color | — |
| background-url | URL string | — |
| background-size | CSS string | auto |
| background-repeat | repeat / no-repeat | — |
| background-position | CSS keyword/% | top center |
| full-width | "full-width" | — |
| border | CSS border | — |
| border-radius | string | — |
| direction | ltr / rtl | ltr |
| gutter | px / % | — |
| padding | px / % | 20px 0 |
| text-align | left/center/right | center |
**`gutter` (MJML 5)**: Sets equal spacing between every column in the section — an alternative to adding matching left/right padding to each `mj-column` by hand. Works with `mj-group` children too, and respects `direction="rtl"`.
**Outlook background images**: Only `mj-section` and `mj-hero` support background images (MJML generates VML). Always set `background-size` and `background-color` fallback when using `background-url`. Use keyword positions (top, center) not pixels for Outlook.
```xml
<mj-section background-url="https://..." background-color="#2a3448"
background-size="cover" background-repeat="no-repeat">
```
---
## mj-column
A responsive column inside a section. Columns stack vertically on mobile by default.
Width is auto-calculated: 2 columns = 50% each, 3 columns = 33.33% each. Override with `width`.
| Attribute | Accepts | Default |
|-----------|---------|---------|
| width | px / % | (100 / col count)% |
| background-color | CSS color | — |
| inner-background-color | CSS color | — |
| border | CSS border | — |
| border-radius | px / % | — |
| vertical-align | top/middle/bottom | top |
| padding | px / % | — |
| direction | ltr / rtl | ltr |
**vertical-align bug**: If any column in a section uses `vertical-align="middle"`, ALL columns in that section must also explicitly set `vertical-align="middle"` for it to render consistently.
```xml
<mj-section>
<mj-column width="40%">...</mj-column>
<mj-column width="60%">...</mj-column>
</mj-section>
```
---
## mj-group
Prevents columns from stacking on mobile. Wrap columns in `mj-group` to keep them side-by-side on small screens (e.g. social bars, logo headers).
| Attribute | Accepts | Default |
|-----------|---------|---------|
| width | px / % | (100 / count)% |
| background-color | CSS color | — |
| direction | ltr / rtl | ltr |
| vertical-align | CSS value | — |
**iOS stacking bug**: Even with `mj-group`, whitespace between tags can cause stacking. What prevents it is the `font-size:0px` MJML puts on the parent `<td>`. Note that in MJML 5 `--config.minify` no longer removes inter-tag whitespace (it collapses it to one space); add `--config.minifyOptions '{"collapseWhitespace":"all"}'` for the MJML 4 behavior.
```xml
<mj-section>
<mj-group>
<mj-column><mj-image src="icon1.png" alt="Facebook" /></mj-column>
<mj-column><mj-image src="icon2.png" alt="Twitter" /></mj-column>
</mj-group>
</mj-section>
```
---
## mj-wrapper
Groups multiple `mj-section` elements with a shared border, background, or padding. Useful for card-style layouts.
| Attribute | Accepts | Default |
|-----------|---------|---------|
| background-color | CSS color | — |
| background-url | URL | — |
| background-size | CSS string | auto |
| border | CSS border | — |
| border-radius | string | — |
| full-width | "full-width" | — |
| padding | px / % | 20px 0 |
| gap | px | — |
| gutter | px / % | — (MJML 5) |
```xml
<mj-wrapper border="1px solid #e0e0e0" padding="20px 0">
<mj-section>...</mj-section>
<mj-section>...</mj-section>
</mj-wrapper>
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |