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

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

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

UI Awesome HTML Mixin Library for PHP.

0.4.2(3mo ago)118.9k3BSD-3-ClausePHPPHP ^8.1CI passing

Since Mar 5Pushed 2mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (10)Versions (22)Used By (3)

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

Html mixin
==========

[](#html-mixin)

 [ ![PHPUnit](https://camo.githubusercontent.com/d702c61f0b046acbeade0190016d92609c0c652b290f5c5c27918de7839792f5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f75692d617765736f6d652f68746d6c2d6d6978696e2f6275696c642e796d6c3f7374796c653d666f722d7468652d6261646765266c6162656c3d504850556e6974266c6f676f3d676974687562) ](https://github.com/ui-awesome/html-mixin/actions/workflows/build.yml) [ ![Mutation Testing](https://camo.githubusercontent.com/6393e64799655b0a98f2018133bdc348ac1c768639cd971d0f8573780f2ecb04/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666f722d7468652d62616467652675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d25324675692d617765736f6d6525324668746d6c2d6d6978696e2532466d61696e) ](https://dashboard.stryker-mutator.io/reports/github.com/ui-awesome/html-mixin/main) [ ![PHPStan](https://camo.githubusercontent.com/a80f56cf67ac96f4ab29c6bdae18045b802cc1c36cb6b17e03f6d42e93561e04/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f75692d617765736f6d652f68746d6c2d6d6978696e2f7374617469632e796d6c3f7374796c653d666f722d7468652d6261646765266c6162656c3d5048505374616e266c6f676f3d676974687562) ](https://github.com/ui-awesome/html-mixin/actions/workflows/static.yml)

 **A type-safe PHP mixin library for HTML tag rendering components**
 *Build reusable components with traits for attributes, content, templates, and prefix/suffix management.*

Features
--------

[](#features)

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

[](#installation)

```
composer require ui-awesome/html-mixin:^0.5
```

### Quick start

[](#quick-start)

#### Managing HTML attributes with HasAttributes

[](#managing-html-attributes-with-hasattributes)

The `HasAttributes` trait provides a fluent, immutable API for managing HTML attributes on elements. Supports enum keys/values, closure-based values, prefix normalization (for example `aria-`, `data-`, `on`), and array merging.

```
