{"id":18794405,"url":"https://github.com/ui-awesome/html","last_synced_at":"2026-05-03T02:14:42.376Z","repository":{"id":226098699,"uuid":"767561318","full_name":"ui-awesome/html","owner":"ui-awesome","description":"UI Awesome HTML code generator for PHP.","archived":false,"fork":false,"pushed_at":"2024-03-31T12:24:09.000Z","size":248,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-08T18:07:54.958Z","etag":null,"topics":["code-generator","html","php","ui-awesome"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ui-awesome.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-05T14:15:16.000Z","updated_at":"2024-03-27T16:17:19.000Z","dependencies_parsed_at":"2024-11-07T21:31:46.118Z","dependency_job_id":"97a83b4e-f988-4ae3-899f-d54c451cd2fa","html_url":"https://github.com/ui-awesome/html","commit_stats":null,"previous_names":["ui-awesome/html"],"tags_count":6,"template":false,"template_full_name":"yii-tools/template","purl":"pkg:github/ui-awesome/html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ui-awesome%2Fhtml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ui-awesome%2Fhtml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ui-awesome%2Fhtml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ui-awesome%2Fhtml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ui-awesome","download_url":"https://codeload.github.com/ui-awesome/html/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ui-awesome%2Fhtml/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265401108,"owners_count":23758955,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generator","html","php","ui-awesome"],"created_at":"2024-11-07T21:29:23.221Z","updated_at":"2026-05-03T02:14:42.370Z","avatar_url":"https://github.com/ui-awesome.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD041 --\u003e\n\u003cp align=\"center\"\u003e\n    \u003cpicture\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/ui-awesome/.github/refs/heads/main/logo/ui_awesome.png\" alt=\"UI Awesome\" width=\"25%\"\u003e\n    \u003c/picture\u003e\n    \u003ch1 align=\"center\"\u003eHtml\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\u003c!-- markdownlint-enable MD041 --\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/ui-awesome/html/actions/workflows/build.yml\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/ui-awesome/html/build.yml?style=for-the-badge\u0026label=PHPUnit\u0026logo=github\" alt=\"PHPUnit\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://dashboard.stryker-mutator.io/reports/github.com/ui-awesome/html/main\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/endpoint?style=for-the-badge\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fui-awesome%2Fhtml%2Fmain\" alt=\"Mutation Testing\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ui-awesome/html/actions/workflows/static.yml\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/ui-awesome/html/static.yml?style=for-the-badge\u0026label=PHPStan\u0026logo=github\" alt=\"PHPStan\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cstrong\u003eA fluent, immutable PHP library for generating HTML elements with typed attribute helpers.\u003c/strong\u003e\u003cbr\u003e\n    \u003cem\u003eSafe by default content encoding, raw HTML when needed, and standards-compliant rendering.\u003c/em\u003e\n\u003c/p\u003e\n\n## Features\n\n\u003cpicture\u003e\n    \u003csource media=\"(min-width: 768px)\" srcset=\"./docs/svgs/features.svg\"\u003e\n    \u003cimg src=\"./docs/svgs/features-mobile.svg\" alt=\"Feature Overview\" style=\"width: 100%;\"\u003e\n\u003c/picture\u003e\n\n### Installation\n\n```bash\ncomposer require ui-awesome/html:^0.4\n```\n\n### Quick start\n\nThis package provides immutable, fluent wrapper classes for common HTML elements.\n\nIt supports safe content encoding via `content()`, raw HTML via `html()`, and composition using element instances.\n\n#### Document skeleton + composition + immutability\n\n```php\nuse UIAwesome\\Html\\Flow\\{Div, Main, P};\nuse UIAwesome\\Html\\Heading\\H1;\nuse UIAwesome\\Html\\Metadata\\{Link, Meta, Title};\nuse UIAwesome\\Html\\Palpable\\A;\nuse UIAwesome\\Html\\Root\\{Body, Head, Html};\n\n$baseLink = A::tag()-\u003eclass('nav-link');\n\necho Html::tag()\n    -\u003elang('en')\n    -\u003ehtml(\n        Head::tag()-\u003ehtml(\n            Meta::tag()-\u003echarset('utf-8'),\n            Meta::tag()-\u003ename('viewport')-\u003econtent('width=device-width, initial-scale=1'),\n            Title::tag()-\u003econtent('UI Awesome HTML'),\n            Link::tag()-\u003erel('stylesheet')-\u003ehref('/assets/app.css'),\n        ),\n        Body::tag()-\u003eclass('app')-\u003ehtml(\n            Main::tag()-\u003eclass('container')-\u003ehtml(\n                H1::tag()-\u003econtent('UI Awesome HTML'),\n                P::tag()-\u003econtent('Build HTML with a fluent, immutable API.'),\n                Div::tag()-\u003eclass('nav')-\u003ehtml(\n                    $baseLink-\u003ehref('/docs')-\u003econtent('Documentation'),\n                    $baseLink-\u003ehref('/github')-\u003econtent('GitHub'),\n                ),\n            ),\n        ),\n    )\n    -\u003erender();\n```\n\n#### Safe content vs raw HTML\n\n```php\nuse UIAwesome\\Html\\Flow\\Div;\n\necho Div::tag()-\u003econtent('\u003cstrong\u003eencoded\u003c/strong\u003e')-\u003erender();\n// \u003cdiv\u003e\u0026lt;strong\u0026gt;encoded\u0026lt;/strong\u0026gt;\u003c/div\u003e\n\necho Div::tag()-\u003ehtml('\u003cstrong\u003eraw\u003c/strong\u003e')-\u003erender();\n// \u003cdiv\u003e\n// \u003cstrong\u003eraw\u003c/strong\u003e\n// \u003c/div\u003e\n```\n\n#### Powerful list composition\n\nCreate ordered lists, unordered lists, and description lists with a fluent API.\n\n```php\nuse UIAwesome\\Html\\List\\{Dl, Ol, Ul};\n\n// Unordered list with items\n$features = Ul::tag()\n    -\u003eclass('feature-list')\n    -\u003eitems(\n        'Immutable by design',\n        'Type-safe attributes',\n        'Fluent API',\n        'Standards-compliant',\n    );\n\n// Ordered list with custom start and nested items\n$steps = Ol::tag()\n    -\u003eclass('steps')\n    -\u003estart(1)\n    -\u003ereversed(false)\n    -\u003eli('Install with Composer', 1)\n    -\u003eli('Create HTML elements', 2)\n    -\u003eli('Render to string', 3);\n\n// Description list for metadata or glossaries\n$metadata = Dl::tag()\n    -\u003eclass('metadata-list')\n    -\u003edt('Package')\n    -\u003edd('ui-awesome/html')\n    -\u003edt('Version')\n    -\u003edd('0.4.0')\n    -\u003edt('License')\n    -\u003edd('BSD-3-Clause');\n\n// Render all lists\n$html = $features-\u003erender() . PHP_EOL . $steps-\u003erender() . PHP_EOL . $metadata-\u003erender();\n```\n\n## Documentation\n\nFor detailed testing and quality workflows.\n\n- [Testing Guide](docs/testing.md)\n\n## Package information\n\n[![PHP](https://img.shields.io/badge/%3E%3D8.3-777BB4.svg?style=for-the-badge\u0026logo=php\u0026logoColor=white)](https://www.php.net/releases/8.3/en.php)\n[![Latest Stable Version](https://img.shields.io/packagist/v/ui-awesome/html.svg?style=for-the-badge\u0026logo=packagist\u0026logoColor=white\u0026label=Stable)](https://packagist.org/packages/ui-awesome/html)\n[![Total Downloads](https://img.shields.io/packagist/dt/ui-awesome/html.svg?style=for-the-badge\u0026logo=composer\u0026logoColor=white\u0026label=Downloads)](https://packagist.org/packages/ui-awesome/html)\n\n## Quality code\n\n[![Codecov](https://img.shields.io/codecov/c/github/ui-awesome/html.svg?style=for-the-badge\u0026logo=codecov\u0026logoColor=white\u0026label=Coverage)](https://codecov.io/github/ui-awesome/html)\n[![PHPStan Level Max](https://img.shields.io/badge/PHPStan-Level%20Max-4F5D95.svg?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/ui-awesome/html/actions/workflows/static.yml)\n[![Super-Linter](https://img.shields.io/github/actions/workflow/status/ui-awesome/html/linter.yml?style=for-the-badge\u0026label=Super-Linter\u0026logo=github)](https://github.com/ui-awesome/html/actions/workflows/linter.yml)\n[![StyleCI](https://img.shields.io/badge/StyleCI-Passed-44CC11.svg?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.styleci.io/repos/776094320?branch=main)\n\n## Our social networks\n\n[![Follow on X](https://img.shields.io/badge/-Follow%20on%20X-1DA1F2.svg?style=for-the-badge\u0026logo=x\u0026logoColor=white\u0026labelColor=000000)](https://x.com/Terabytesoftw)\n\n## License\n\n[![License](https://img.shields.io/badge/License-BSD--3--Clause-brightgreen.svg?style=for-the-badge\u0026logo=opensourceinitiative\u0026logoColor=white\u0026labelColor=555555)](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fui-awesome%2Fhtml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fui-awesome%2Fhtml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fui-awesome%2Fhtml/lists"}