PHPackages                             klan1/k1.lib-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. [Templating &amp; Views](/categories/templating)
4. /
5. klan1/k1.lib-html

ActiveLibrary[Templating &amp; Views](/categories/templating)

klan1/k1.lib-html
=================

HTML components for k1lib

2.1.0(1mo ago)093Apache-2.0PHPPHP ^8.2

Since May 26Pushed 1mo agoCompare

[ Source](https://github.com/klan1/k1.lib-html)[ Packagist](https://packagist.org/packages/klan1/k1.lib-html)[ RSS](/packages/klan1-k1lib-html/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (3)Used By (3)

k1.lib-html
===========

[](#k1lib-html)

A comprehensive PHP library for generating HTML documents and components using an object-oriented approach. This package is a modular extraction of the HTML generation tools from the main `k1.lib` library.

Features
--------

[](#features)

- **DOM-like Structure**: Create HTML documents by nesting objects, mirroring the natural structure of HTML.
- **Comprehensive Tag Support**: Dedicated classes for almost all standard HTML tags (`div`, `table`, `form`, `input`, `p`, etc.). Recently expanded to include full Semantic Layout, Text Formatting, Table and List tags.
- **Framework Integrations**: Built-in support for Bootstrap specialized components and methods for layouts.
- **Flexible Attributes**: Easily set and modify HTML attributes through a fluent API.
- **Component-Based**: Includes reusable components like accordions, modals, and grids.

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

[](#installation)

Install via Composer:

```
composer require klan1/k1.lib-html
```

Quick Start
-----------

[](#quick-start)

```
use k1lib\html\html_document;
use k1lib\html\body;
use k1lib\html\div;

$doc = new html_document();
$body = $doc->append_body();
$div = $body->append_div("main-container");
$div->set_value("Hello, k1lib.html!");

echo $doc->generate();
```

Debug Mode
----------

[](#debug-mode)

Enable debug mode to automatically add `class_name` attributes to all generated HTML tags, showing the PHP class name that generated each element:

```
// Enable debug mode
\k1lib\html\tag::debug(true);

// Now all generate() calls will include class_name attribute
$div = new \k1lib\html\div();
$div->set_value("Content");
// Output: Content

// Disable debug mode
\k1lib\html\tag::debug(false);

// Check current debug state
$isDebug = \k1lib\html\tag::debug(); // returns bool
```

License
-------

[](#license)

This project is licensed under the Apache-2.0 License.

---

Alejandro Trujillo J. \*\*GitHub: \*\*[github.com/j0hnd03](https://github.com/j0hnd03)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance88

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

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 ~0 days

Total

2

Last Release

59d ago

Major Versions

v1.0.0 → 2.1.02026-05-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c674d4ed1f2cdf262687201585bf2c40914489754f482f99b8b38cc569461aa?d=identicon)[Klan1 Labs](/maintainers/Klan1%20Labs)

---

Top Contributors

[![j0hnd03](https://avatars.githubusercontent.com/u/336013?v=4)](https://github.com/j0hnd03 "j0hnd03 (63 commits)")

### Embed Badge

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

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

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

282.2k](/packages/webkinder-sproutset)

PHPackages © 2026

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