PHPackages                             krishnapawar/php-html-builder - 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. krishnapawar/php-html-builder

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

krishnapawar/php-html-builder
=============================

PHP HTML Builder - A Lightweight Alternative to LaravelCollective/HTML and Spatie/Laravel-HTML With the release of Laravel 11, support for laravelcollective/html has been discontinued, leaving many developers searching for a modern, simple solution to generate HTML and form elements. PHP HTML Builder is here to fill that gap — offering a streamlined, intuitive alternative compatible with Laravel 9, 10, and 11. This package provides an easy-to-use, fluent API that replicates the functionality of laravelcollective/html and spatie/laravel-html, enabling developers to effortlessly create HTML components, forms, inputs, checkboxes, radio buttons, dropdowns, links, images, and more. Built with simplicity and flexibility in mind, PHP HTML Builder is a lightweight, PHP-first solution for building and managing dynamic user interfaces in Laravel applications.

v1.0.0(1y ago)025MITPHPPHP &gt;=8.2

Since Feb 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/krishnapawar/php-html-builder)[ Packagist](https://packagist.org/packages/krishnapawar/php-html-builder)[ RSS](/packages/krishnapawar-php-html-builder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP HTML Builder - A Lightweight Alternative to LaravelCollective/HTML and Spatie/Laravel-HTML
==============================================================================================

[](#php-html-builder---a-lightweight-alternative-to-laravelcollectivehtml-and-spatielaravel-html)

With the release of Laravel 11, support for laravelcollective/html has been discontinued, leaving many developers searching for a modern, simple solution to generate HTML and form elements. PHP HTML Builder is here to fill that gap — offering a streamlined, intuitive alternative compatible with Laravel 9, 10, and 11.

This package provides an easy-to-use, fluent API that replicates the functionality of laravelcollective/html and spatie/laravel-html, enabling developers to effortlessly create HTML components, forms, inputs, checkboxes, radio buttons, dropdowns, links, images, and more.

Built with simplicity and flexibility in mind, PHP HTML Builder is a lightweight, PHP-first solution for building and managing dynamic user interfaces in Laravel applications.

📌 Features
----------

[](#-features)

- 🏗 **Alternative to `laravelcollective/html`** for Laravel 11+
- ✨ Simple and clean syntax for generating HTML and form elements
- 📝 Supports forms, inputs, selects, checkboxes, buttons, and modals
- 🌍 Works in both Laravel and standalone PHP projects
- 🎨 Fully customizable with attributes

---

🔧 Installation
--------------

[](#-installation)

```
composer require krishnapawar/php-html-builder
```

---

🚀 Usage Examples
----------------

[](#-usage-examples)

### **1️⃣ Generating Basic HTML Elements**

[](#1️⃣-generating-basic-html-elements)

```
use KrishnaPawar\HtmlBuilder\Html;

// Link
echo Html::link("https://example.com", "Visit Website", ["target" => "_blank"]);

// Image
echo Html::image("logo.png", "Website Logo");

// Inline CSS
echo Html::style("body { background-color: #f4f4f4; }");

// Inline JavaScript
echo Html::script("console.log('Hello, World!');");

// External CSS
echo Html::stylesheet("https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css");

// External JavaScript
echo Html::scriptSrc("https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js");
```

### **2️⃣ Generating Forms and Inputs**

[](#2️⃣-generating-forms-and-inputs)

```
use KrishnaPawar\HtmlBuilder\Form;

// Open Form
echo Form::open("submit.php", "POST");

// Input Fields
echo Form::input("name", "text", "", ["placeholder" => "Enter Name"]);
echo Form::input("email", "email", "", ["placeholder" => "Enter Email"]);

// Select Dropdown
echo Form::select("role", ["admin" => "Admin", "user" => "User"], "user");

// Checkbox
echo Form::checkbox("subscribe", "yes", true);

// Submit Button
echo Form::submit("Send");

// Close Form
echo Form::close();
```

### **3️⃣ Creating a Modal**

[](#3️⃣-creating-a-modal)

```
use KrishnaPawar\HtmlBuilder\Form;

// Modal Example
echo Form::modal(
    "myModal",
    "My Modal Title",
    "This is a simple modal body.",
    "Save Changes"
);
```

**Output HTML:**

```

                My Modal Title
                &times;

                This is a simple modal body.

                Save Changes

```

---

📜 License
---------

[](#-license)

This package is open-source and available under the **MIT License**.

---

🤝 Contributing
--------------

[](#-contributing)

Feel free to submit issues, feature requests, or contribute to improving this package!

---

🏷 Tags
------

[](#-tags)

**Laravel**, **HTML Builder**, **PHP Forms**, **HTML Generator**, **LaravelCollective Alternative**, **Web Development**, **PHP Package**, **kp**, **krishnapawar**,**krishna pawar**,**Alternative**,

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance43

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

454d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/efc7f2a968b61917fade0bb0302b439b87d802432123cdb2239cd023a1625834?d=identicon)[krishnapawar](/maintainers/krishnapawar)

---

Top Contributors

[![krishnapawar](https://avatars.githubusercontent.com/u/42169611?v=4)](https://github.com/krishnapawar "krishnapawar (1 commits)")

### Embed Badge

![Health badge](/badges/krishnapawar-php-html-builder/health.svg)

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

555.8M69](/packages/symfony-ux-icons)

PHPackages © 2026

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