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

ActiveLibrary

ui-awesome/html
===============

UI Awesome HTML Code Generator for PHP.

0.3.0(1y ago)17.0k—0%[1 issues](https://github.com/ui-awesome/html/issues)PHPPHP ^8.1CI passing

Since Mar 6Pushed 1w ago1 watchersCompare

[ Source](https://github.com/ui-awesome/html)[ Packagist](https://packagist.org/packages/ui-awesome/html)[ RSS](/packages/ui-awesome-html/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (12)Versions (8)Used By (0)

    ![UI Awesome](https://raw.githubusercontent.com/ui-awesome/.github/refs/heads/main/logo/ui_awesome_dark.png)

Html
====

[](#html)

 [ ![PHPUnit](https://camo.githubusercontent.com/4382d9a90c8ffdccfa28bf654b19e64518a9a508586b63b04576d3729b2ac10e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f75692d617765736f6d652f68746d6c2f6275696c642e796d6c3f7374796c653d666f722d7468652d6261646765266c6162656c3d504850556e6974266c6f676f3d676974687562) ](https://github.com/ui-awesome/html/actions/workflows/build.yml) [ ![Mutation Testing](https://camo.githubusercontent.com/9287f6854970cb90ab755ed304aea2cfe45d3e75ddf62e00c53ed0d0c6850aaf/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666f722d7468652d62616467652675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d25324675692d617765736f6d6525324668746d6c2532466d61696e) ](https://dashboard.stryker-mutator.io/reports/github.com/ui-awesome/html/main) [ ![PHPStan](https://camo.githubusercontent.com/edeaceda11d52051e6dbe2e536bf4518fddfd3fd96b7f23508bc692de8c40689/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f75692d617765736f6d652f68746d6c2f7374617469632e796d6c3f7374796c653d666f722d7468652d6261646765266c6162656c3d5048505374616e266c6f676f3d676974687562) ](https://github.com/ui-awesome/html/actions/workflows/static.yml)

 **A fluent, immutable PHP library for generating HTML elements with typed attribute helpers.**
 *Safe by default content encoding, raw HTML when needed, and standards-compliant rendering.*

Features
--------

[](#features)

  ![Feature Overview](./docs/svgs/features-mobile.svg)### Installation

[](#installation)

```
composer require ui-awesome/html:^0.4
```

### Quick start

[](#quick-start)

This package provides immutable, fluent wrapper classes for common HTML elements.

It supports safe content encoding via `content()`, raw HTML via `html()`, and composition using element instances.

#### Document skeleton + composition + immutability

[](#document-skeleton--composition--immutability)

```
use UIAwesome\Html\Flow\{Div, Main, P};
use UIAwesome\Html\Heading\H1;
use UIAwesome\Html\Metadata\{Link, Meta, Title};
use UIAwesome\Html\Palpable\A;
use UIAwesome\Html\Root\{Body, Head, Html};

$baseLink = A::tag()->class('nav-link');

echo Html::tag()
    ->lang('en')
    ->html(
        Head::tag()->html(
            Meta::tag()->charset('utf-8'),
            Meta::tag()->name('viewport')->content('width=device-width, initial-scale=1'),
            Title::tag()->content('UI Awesome HTML'),
            Link::tag()->rel('stylesheet')->href('/assets/app.css'),
        ),
        Body::tag()->class('app')->html(
            Main::tag()->class('container')->html(
                H1::tag()->content('UI Awesome HTML'),
                P::tag()->content('Build HTML with a fluent, immutable API.'),
                Div::tag()->class('nav')->html(
                    $baseLink->href('/docs')->content('Documentation'),
                    $baseLink->href('/github')->content('GitHub'),
                ),
            ),
        ),
    )
    ->render();
```

#### Safe content vs raw HTML

[](#safe-content-vs-raw-html)

```
use UIAwesome\Html\Flow\Div;

echo Div::tag()->content('encoded')->render();
// &lt;strong&gt;encoded&lt;/strong&gt;

echo Div::tag()->html('raw')->render();
//
// raw
//
```

#### Powerful list composition

[](#powerful-list-composition)

Create ordered lists, unordered lists, and description lists with a fluent API.

```
use UIAwesome\Html\List\{Dl, Ol, Ul};

// Unordered list with items
$features = Ul::tag()
    ->class('feature-list')
    ->items(
        'Immutable by design',
        'Type-safe attributes',
        'Fluent API',
        'Standards-compliant',
    );

// Ordered list with custom start and nested items
$steps = Ol::tag()
    ->class('steps')
    ->start(1)
    ->reversed(false)
    ->li('Install with Composer', 1)
    ->li('Create HTML elements', 2)
    ->li('Render to string', 3);

// Description list for metadata or glossaries
$metadata = Dl::tag()
    ->class('metadata-list')
    ->dt('Package')
    ->dd('ui-awesome/html')
    ->dt('Version')
    ->dd('0.4.0')
    ->dt('License')
    ->dd('BSD-3-Clause');

// Render all lists
$html = $features->render() . PHP_EOL . $steps->render() . PHP_EOL . $metadata->render();
```

Documentation
-------------

[](#documentation)

For detailed configuration options and advanced usage.

- [Testing Guide](docs/testing.md)
- [Development Guide](docs/development.md)

Package information
-------------------

[](#package-information)

[![PHP](https://camo.githubusercontent.com/8c0cc099469e78d1c3ab294bd8b4e29dd7ad459d84ca953058f4034eeb3e0695/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f253345253344382e312d3737374242342e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/releases/8.1/en.php)[![Latest Stable Version](https://camo.githubusercontent.com/c3d36ecd4bae56b3c058b17c27abb9a98a2e39653bd667f08a9bfd43b444ec4a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f75692d617765736f6d652f68746d6c2e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465266c6162656c3d537461626c65)](https://packagist.org/packages/ui-awesome/html)[![Total Downloads](https://camo.githubusercontent.com/f3dc16878b8a3c3caeb75ecf6b127cc1a0091527fce1fdcc8b76a652fa5e4047/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f75692d617765736f6d652f68746d6c2e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d636f6d706f736572266c6f676f436f6c6f723d7768697465266c6162656c3d446f776e6c6f616473)](https://packagist.org/packages/ui-awesome/html)

Quality code
------------

[](#quality-code)

[![Codecov](https://camo.githubusercontent.com/f3b1fb5a2e6e00c9b34234fe4888af422370fe13c2f983d2c85e67025a47dd7e/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f75692d617765736f6d652f68746d6c2e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d636f6465636f76266c6f676f436f6c6f723d7768697465266c6162656c3d436f766572616765)](https://codecov.io/github/ui-awesome/html)[![PHPStan Level Max](https://camo.githubusercontent.com/b1aeb44257ce46737d1787123b534aab9dded28219f828e4ae13a1e3b460f53c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c2532304d61782d3446354439352e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465)](https://github.com/ui-awesome/html/actions/workflows/static.yml)[![Super-Linter](https://camo.githubusercontent.com/3b66275c1b22dbaf76d243453cb65386ffa9c55283fccf14d4c5cd3033aebf61/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f75692d617765736f6d652f68746d6c2f6c696e7465722e796d6c3f7374796c653d666f722d7468652d6261646765266c6162656c3d53757065722d4c696e746572266c6f676f3d676974687562)](https://github.com/ui-awesome/html/actions/workflows/linter.yml)[![StyleCI](https://camo.githubusercontent.com/2e44ba381d6c9ab95b548566772bd17337dc56f8a6a646974bf7277720e5be9d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374796c6543492d5061737365642d3434434331312e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465)](https://github.styleci.io/repos/776094320?branch=main)

Our social networks
-------------------

[](#our-social-networks)

[![Follow on X](https://camo.githubusercontent.com/332c1b1e043dfb940b95825f7863dc473f6924ddacdd6738cbbbba08f49e1862/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d466f6c6c6f772532306f6e253230582d3144413146322e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d78266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d303030303030)](https://x.com/Terabytesoftw)

License
-------

[](#license)

[![License](https://camo.githubusercontent.com/680c8d62ba2d5a71d7099b6e81114fb0b22d99086c121fd178e1149afc669d44/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4253442d2d332d2d436c617573652d627269676874677265656e2e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d6f70656e736f75726365696e6974696174697665266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d353535353535)](LICENSE)

###  Health Score

34

—

LowBetter than 79% of packages

Maintenance49

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Every ~4 days

Total

6

Last Release

720d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/524d2b46690f41fce7188d369488a35e7624e6c5a264d82aacd08548bfd156ab?d=identicon)[terabytesoftw](/maintainers/terabytesoftw)

---

Top Contributors

[![terabytesoftw](https://avatars.githubusercontent.com/u/42547589?v=4)](https://github.com/terabytesoftw "terabytesoftw (94 commits)")

---

Tags

code-generatorhtmlphpui-awesomephpcode generatorhtmlui-awesome

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StyleECS

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[daandesmedt/phpheadlesschrome

A PHP wrapper for using Google Chrome Headless mode. Convert URL or HTML to a PDF / screenshot. Easy to use and OOP interfaced.

92225.4k](/packages/daandesmedt-phpheadlesschrome)

PHPackages © 2026

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