PHPackages                             dmitrivereshchagin/sprout - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dmitrivereshchagin/sprout

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dmitrivereshchagin/sprout
=========================

Simple DOM generator inspired by Emmet

151PHP

Since Feb 12Pushed 9y ago1 watchersCompare

[ Source](https://github.com/dmitrivereshchagin/sprout)[ Packagist](https://packagist.org/packages/dmitrivereshchagin/sprout)[ RSS](/packages/dmitrivereshchagin-sprout/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Sprout [![Build Status](https://camo.githubusercontent.com/6eff3b2f963ef5f6874fec062d3a44f969be858207532424ac3dfe84f768a848/68747470733a2f2f7472617669732d63692e6f72672f646d6974726976657265736863686167696e2f7370726f75742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dmitrivereshchagin/sprout)
=================================================================================================================================================================================================================================================================================================================

[](#sprout-)

Simple DOM generator inspired by [Emmet](http://emmet.io/). Dumb and fluent.

Install
-------

[](#install)

```
% composer require dmitrivereshchagin/sprout

```

Usage
-----

[](#usage)

You can build your DOM from subtrees in the following way (you should avoid recursion though)

```
use Sprout\Node as Root;

$head = Root::create('head')
    ->meta('charset="utf-8"')->merge()
    ->up()
    ->title()->text('Title')
    ->root()
;

$body = Root::create('body')
    ->h1('id="header"')->text('Header')
    ->up()
    ->p()->text('Paragraph of text.')->times(2)
    ->root()
;

echo Root::create('html', 'lang="en"')
    ->insert($head, $body)
;
```

Or you can build entire tree using marked nodes

```
echo Root::create('html', 'lang="en"')->mark('h')
    // head subtree
    // ...
    ->to('h')
    // body subtree
    // ...
    ->root()
;
```

Testing
-------

[](#testing)

```
% composer test

```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b3882ea129b793a5f17988707c4cf3b9d92f43770266a73dae654838b150970?d=identicon)[dmitrivereshchagin](/maintainers/dmitrivereshchagin)

---

Top Contributors

[![dmitrivereshchagin](https://avatars.githubusercontent.com/u/14558877?v=4)](https://github.com/dmitrivereshchagin "dmitrivereshchagin (38 commits)")[![anwinged](https://avatars.githubusercontent.com/u/11515656?v=4)](https://github.com/anwinged "anwinged (2 commits)")

---

Tags

emmethtml

### Embed Badge

![Health badge](/badges/dmitrivereshchagin-sprout/health.svg)

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

###  Alternatives

[ramsey/identifier

A PHP library for generating and working with identifiers, including UUIDs, ULIDs, and Snowflakes

605.2k2](/packages/ramsey-identifier)

PHPackages © 2026

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