PHPackages                             lysande/html - 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. lysande/html

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

lysande/html
============

A small, simple HTML library, inspired by Elm.

0.1.0(9y ago)013[1 issues](https://github.com/Lysande/html/issues)PHPPHP ^5.6.0 || ^7.0

Since Apr 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Lysande/html)[ Packagist](https://packagist.org/packages/lysande/html)[ Docs](http://github.com/lysande/html)[ RSS](/packages/lysande-html/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

html - Write PHP, get HTML
==========================

[](#html---write-php-get-html)

`html` is a small, simple library for HTML markup creation, inspired by [Elm](http://elm-lang.org/).

```
Html::article(["class" => "chapter"], [
  Html::header([
    Html::h1(["class" => "chapter__heading"],
      ["Welcome!"]
    ),
  ]),
  Html::div(
    [
      "class" => "chapter__body",
      "style" => ["text-transform" => "uppercase"]
    ],
    ["Lorem ipsum dolor sit amet"]
  )
])
```

How does it work?
-----------------

[](#how-does-it-work)

Each HTML element is available as a static method on `Html`, along with the arbitrary methods `Html::element` and `Html::emptyElement`.

Both `Html::element` and `Html::emptyElement` take a tag name, followed by attributes. Non-empty elements take a list of children, as well. Everything gets passed in as arrays, both attributes and children. Child elements are recursively rendered, and attributes are rendered according to a predefined ruleset.

The default ruleset is the standard HTML attribute format, `attribute="value"`. There are also formats defined for `style`, `sizes` and `srcset`.

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

[](#installation)

Clone repo, download and unpackage the files, or [install via Composer](https://packagist.org/). The package is available as `lysande/html`.

In the future
-------------

[](#in-the-future)

- Allow elements to define children, without attributes
- React-/JSX-like `true/false` for boolean attributes
- Declare singular children without arrays

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

3366d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/118441607?v=4)[svartkonst](/maintainers/svartkonst)[@svartkonst](https://github.com/svartkonst)

---

Top Contributors

[![svrtknst](https://avatars.githubusercontent.com/u/3249676?v=4)](https://github.com/svrtknst "svrtknst (20 commits)")

---

Tags

htmlmarkupelm

### Embed Badge

![Health badge](/badges/lysande-html/health.svg)

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

###  Alternatives

[spatie/laravel-html

A fluent html builder

8307.1M91](/packages/spatie-laravel-html)[caxy/php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML.

21421.8M20](/packages/caxy-php-htmldiff)[yajra/laravel-datatables-html

Laravel DataTables HTML builder plugin

28410.1M49](/packages/yajra-laravel-datatables-html)[wa72/htmlpagedom

jQuery-inspired DOM manipulation extension for Symfony's Crawler

3384.0M34](/packages/wa72-htmlpagedom)[tinymce/tinymce

Web based JavaScript HTML WYSIWYG editor control.

1707.9M118](/packages/tinymce-tinymce)[voku/html-min

HTML Compressor and Minifier

1814.9M58](/packages/voku-html-min)

PHPackages © 2026

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