PHPackages                             yarri/mjml - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. yarri/mjml

ActiveLibrary[Templating &amp; Views](/categories/templating)

yarri/mjml
==========

PHP implementation of the MJML email templating language

v0.2(1mo ago)13163↑100%MITPHPPHP &gt;=7.1CI passing

Since May 6Pushed 1w ago2 watchersCompare

[ Source](https://github.com/yarri/Mjml)[ Packagist](https://packagist.org/packages/yarri/mjml)[ Docs](https://github.com/yarri/)[ RSS](/packages/yarri-mjml/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

yarri/mjml
==========

[](#yarrimjml)

[![Tests](https://github.com/yarri/Mjml/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/yarri/Mjml/actions/workflows/tests.yml)

PHP implementation of the [MJML](https://mjml.io/) email templating language. Converts MJML markup into responsive HTML emails — without Node.js at runtime.

Requirements
------------

[](#requirements)

- PHP 7.1+

Installation
------------

[](#installation)

```
composer require yarri/mjml
```

Usage
-----

[](#usage)

```
$mjml = '

            Hello World
            Check this out!

                    Hello World
                    Click here

';

$html = Yarri\Mjml::Mjml2Html($mjml);
```

Supported components
--------------------

[](#supported-components)

### Head

[](#head)

ComponentDescription`mj-title`Sets the `` of the email`mj-preview`Adds a preview text (hidden preheader)`mj-font`Imports a web font (only if used in `font-family`)`mj-breakpoint`Sets the responsive breakpoint width (default: 480px)`mj-style`Injects custom CSS into the ```mj-attributes`Sets default attribute values for components (`mj-all` applies to all)`mj-html-attributes`Injects custom HTML attributes into rendered elements by CSS class selector### Body

[](#body)

ComponentDescription`mj-body`Root body element`mj-section`A horizontal section; supports background color, image, full-width`mj-column`Column inside a section; supports border, padding, background`mj-wrapper`Wraps sections; useful for shared backgrounds`mj-group`Groups columns for Outlook compatibility`mj-hero`Full-width hero with background image`mj-text`A block of text`mj-image`An image`mj-button`A call-to-action button`mj-divider`A horizontal rule`mj-spacer`Vertical whitespace`mj-table`An HTML table`mj-raw`Raw HTML passthrough (not processed)`mj-social`A row of social media icons`mj-social-element`A single social media link`mj-navbar`A responsive navigation bar`mj-navbar-link`A link inside a navbar`mj-accordion`A collapsible accordion`mj-accordion-element`A single accordion item`mj-accordion-title`Title of an accordion item`mj-accordion-text`Body of an accordion item`mj-carousel`An image carousel`mj-carousel-image`A single image in a carouselTesting
-------

[](#testing)

The test suite compares output against the reference Node.js MJML 4.18.0 implementation. Install Node.js dependencies first:

```
nvm use
npm install
```

Then run the tests:

```
./vendor/bin/run_unit_tests test/
```

Run a single test case:

```
./vendor/bin/run_unit_tests test/tc_mj_column.php
```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance96

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

33d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/974278?v=4)[Jaromir Tomek](/maintainers/yarri)[@yarri](https://github.com/yarri)

---

Top Contributors

[![yarri](https://avatars.githubusercontent.com/u/974278?v=4)](https://github.com/yarri "yarri (55 commits)")

### Embed Badge

![Health badge](/badges/yarri-mjml/health.svg)

```
[![Health](https://phpackages.com/badges/yarri-mjml/health.svg)](https://phpackages.com/packages/yarri-mjml)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.2M](/packages/limenius-react-bundle)[wmde/php-vuejs-templating

PHP implementation of Vue.js templating engine

3041.6k2](/packages/wmde-php-vuejs-templating)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

291.8k](/packages/webkinder-sproutset)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
