PHPackages                             vitexsoftware/ease-twbootstrap5 - 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. vitexsoftware/ease-twbootstrap5

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

vitexsoftware/ease-twbootstrap5
===============================

Set of Twitter Bootstrap 5 rendering objects

1.2.0(1y ago)56102[2 issues](https://github.com/VitexSoftware/php-ease-twbootstrap5/issues)[4 PRs](https://github.com/VitexSoftware/php-ease-twbootstrap5/pulls)2MITPHPCI failing

Since Oct 6Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/VitexSoftware/php-ease-twbootstrap5)[ Packagist](https://packagist.org/packages/vitexsoftware/ease-twbootstrap5)[ RSS](/packages/vitexsoftware-ease-twbootstrap5/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (6)Versions (13)Used By (2)

php-ease-twbootstrap5
=====================

[](#php-ease-twbootstrap5)

TwitterBootstrap5 classes for EasePHP Framework

[![twbootstrap5](php-vitexsoftware-ease-twbootstrap5.svg?raw=true)](php-vitexsoftware-ease-twbootstrap5.svg?raw=true)

> **Note**: If you are looking for a similar PHP library for Bootstrap 4, you can find it at [php-ease-twbootstrap4](https://github.com/VitexSoftware/php-ease-twbootstrap4.git).

Overview
--------

[](#overview)

A comprehensive set of PHP classes for building Bootstrap 5 UI components within the EasePHP Framework. Each class wraps a specific Bootstrap 5 component and generates the correct HTML structure and CSS classes automatically.

Targets **Bootstrap 5.3**.

Classes and Their Functionalities
---------------------------------

[](#classes-and-their-functionalities)

### Accordion.php

[](#accordionphp)

- **Functionality**: Collapsible content panels.
- **Features**: Items added via `addAccordionItem()`; supports `alwaysOpen` mode (multiple sections open simultaneously).

```
use Ease\TWB5\Accordion;

$accordion = new Accordion('faq', [
    'What is Bootstrap?' => 'A CSS framework.',
    'What is EasePHP?'   => 'A PHP rendering library.',
]);
$accordion->addAccordionItem('Custom item', 'Added programmatically.', true);
echo $accordion->draw();
```

### Alert.php

[](#alertphp)

- **Functionality**: Create and manage Bootstrap alert messages.
- **Features**: Supports contextual types (`success`, `danger`, `warning`, `info`, `primary`, `secondary`, `light`, `dark`).

```
use Ease\TWB5\Alert;

$alert = new Alert('success', 'Operation completed successfully!');
echo $alert->draw();
```

### Badge.php

[](#badgephp)

- **Functionality**: Generate Bootstrap badges.
- **Features**: Supports all contextual colors via `text-bg-*` classes.

```
use Ease\TWB5\Badge;

$badge = new Badge('New', 'primary');
echo $badge->draw();
```

### Breadcrumb.php

[](#breadcrumbphp)

- **Functionality**: Navigation path (breadcrumb trail).
- **Features**: Accepts ordered `['Label' => 'url']` pairs; the last item is automatically marked active.

```
use Ease\TWB5\Breadcrumb;

$breadcrumb = new Breadcrumb([
    'Home'    => '/',
    'Library' => '/library',
    'Data'    => '',
]);
echo $breadcrumb->draw();
```

### ButtonGroup.php

[](#buttongroupphp)

- **Functionality**: Group multiple buttons into a single line.
- **Features**: Size variants (`lg`, `sm`), vertical stacking.

```
use Ease\TWB5\ButtonGroup;
use Ease\Html\ButtonTag;

$group = new ButtonGroup([
    new ButtonTag('Left',   ['class' => 'btn btn-primary']),
    new ButtonTag('Middle', ['class' => 'btn btn-primary']),
    new ButtonTag('Right',  ['class' => 'btn btn-primary']),
], '', false, 'Toolbar');
echo $group->draw();
```

### Card.php

[](#cardphp)

- **Functionality**: Create Bootstrap card components.
- **Features**: Generic card container; use `Panel` for a structured header/body/footer layout.

```
use Ease\TWB5\Card;

$card = new Card('This is the card body content.');
echo $card->draw();
```

### Col.php

[](#colphp)

- **Functionality**: Define column layouts using Bootstrap's grid system.
- **Features**: Supports column sizes 1–12 and responsive breakpoints (`xs`, `sm`, `md`, `lg`, `xl`, `xxl`).

### Collapse.php

[](#collapsephp)

- **Functionality**: Togglable content panel.
- **Features**: `triggerButton()` returns a ready-made toggle button; supports open-by-default state.

```
use Ease\TWB5\Collapse;

$collapse = new Collapse('details', 'Hidden content revealed on click.');
echo $collapse->triggerButton('Show details')->draw();
echo $collapse->draw();
```

### Container.php

[](#containerphp)

- **Functionality**: Create Bootstrap container elements.
- **Features**: Supports fluid and fixed-width containers.

```
use Ease\TWB5\Container;

$container = new Container('This is a container.');
echo $container->draw();
```

### Form.php

[](#formphp)

- **Functionality**: Generate Bootstrap forms.
- **Features**: Wraps inputs in a div; auto-applies `form-control` to added inputs; use `addInput()` for labelled input groups.

```
use Ease\TWB5\Form;
use Ease\Html\InputTextTag;

$form = new Form(['method' => 'POST', 'action' => '/submit']);
$form->addInput(new InputTextTag('username'), 'Username');
echo $form->draw();
```

### FormGroup.php

[](#formgroupphp)

- **Functionality**: Group form controls with labels and help text.
- **Features**: Supports different form group layouts and validation states.

### InputGroup.php

[](#inputgroupphp)

- **Functionality**: Create input groups with prepend text or elements.
- **Features**: Supports various input types and custom addon elements.

### LinkButton.php

[](#linkbuttonphp)

- **Functionality**: Generate Bootstrap-styled anchor (``) buttons.
- **Features**: Supports all button variants (`primary`, `secondary`, `success`, `danger`, `warning`, `info`, `light`, `dark`, `link`); defaults to `secondary`.

```
use Ease\TWB5\LinkButton;

$linkButton = new LinkButton('https://example.com', 'Click Me', 'primary');
echo $linkButton->draw();
```

### ListGroup.php

[](#listgroupphp)

- **Functionality**: Versatile Bootstrap list component.
- **Features**: Plain items or linked items via `['label' => 'url']`; flush and numbered variants; `addListItem()` for contextual colors and active state.

```
use Ease\TWB5\ListGroup;

$list = new ListGroup([
    'Settings' => '/settings',
    'Profile'  => '/profile',
]);
$list->addListItem('Notifications', 'warning');
echo $list->draw();
```

### Modal.php

[](#modalphp)

- **Functionality**: Bootstrap modal dialog.
- **Features**: `triggerButton()` returns a ready-made button; optional footer; size variants (`sm`, `lg`, `xl`); public `$header`, `$body`, `$footer` for further customisation.

```
use Ease\TWB5\Modal;

$modal = new Modal('confirmDelete', 'Confirm', 'Are you sure?', 'This cannot be undone.');
echo $modal->triggerButton('Delete', 'danger')->draw();
echo $modal->draw();
```

### Nav.php

[](#navphp)

- **Functionality**: Standalone Bootstrap navigation component.
- **Features**: Plain, tabs, and pills styles; fill and justified variants; `addNavItem()` for active/disabled states.

```
use Ease\TWB5\Nav;

$nav = new Nav([
    'Home'    => '/',
    'About'   => '/about',
    'Contact' => '/contact',
], 'tabs');
echo $nav->draw();
```

### NavItemDropDown.php

[](#navitemdropdownphp)

- **Functionality**: Dropdown menu item for use inside a Navbar.
- **Features**: Supports multiple items and dividers via `addDropdownItem()`.

```
use Ease\TWB5\NavItemDropDown;

$dropdown = new NavItemDropDown('More', [
    'Action'        => '#action',
    'Another action'=> '#another-action',
    ''              => '',        // divider
    'Something else'=> '#else',
]);
echo $dropdown->draw();
```

### Navbar.php

[](#navbarphp)

- **Functionality**: Generate Bootstrap navigation bars.
- **Features**: Responsive toggle, brand element, dropdown menus, and search form support.

```
use Ease\TWB5\Navbar;

$navbar = new Navbar('My Website', [
    'Home'  => '#home',
    'About' => '#about',
]);
echo $navbar->draw();
```

### OffCanvas.php

[](#offcanvasphp)

- **Functionality**: Bootstrap offcanvas slide-in panel.
- **Features**: Title, close button, and arbitrary body content.

```
use Ease\TWB5\OffCanvas;

$offcanvas = new OffCanvas('sidebar', 'Slide-in Menu', 'Panel body content here.');
echo $offcanvas->draw();
```

### Pagination.php

[](#paginationphp)

- **Functionality**: Page navigation controls.
- **Features**: Auto-generates numbered pages with previous/next controls; disabled states for boundary pages; size variants (`lg`, `sm`).

```
use Ease\TWB5\Pagination;

$pagination = new Pagination(3, 10, '?page=%d');
echo $pagination->draw();
```

### Panel.php

[](#panelphp)

- **Functionality**: Card-based panel with distinct header, body, and footer sections.
- **Features**: Extends `Card`; contextual background colors (`success`, `warning`, `info`, `danger`); sections only render when they contain content; `addItem()` inserts into the body.

```
use Ease\TWB5\Panel;

$panel = new Panel('Panel Heading', 'success', 'Panel body content.', 'Panel footer');
$panel->addItem('More body content');
echo $panel->draw();
```

### Part.php

[](#partphp)

- **Functionality**: Base class for reusable component parts.
- **Features**: Provides `twBootstrapize()` to apply Bootstrap styling to arbitrary HTML elements.

### Progress.php

[](#progressphp)

- **Functionality**: Bootstrap progress bar.
- **Features**: Contextual colors, striped and animated variants, custom min/max range, optional label.

```
use Ease\TWB5\Progress;

$progress = new Progress(65, 0, 100, 'success');
echo $progress->draw();

// Striped and animated
$progress = new Progress(40, 0, 100, 'warning', true, true, '40%');
echo $progress->draw();
```

### Row.php

[](#rowphp)

- **Functionality**: Bootstrap grid row.
- **Features**: Optional row-cols helper; `addColumn()` shortcut creates a `Col` inside the row.

```
use Ease\TWB5\Row;
use Ease\TWB5\Col;

$row = new Row([
    new Col(6, 'Left column'),
    new Col(6, 'Right column'),
]);
echo $row->draw();
```

### Spinner.php

[](#spinnerphp)

- **Functionality**: Bootstrap loading indicator.
- **Features**: `border` (ring) and `grow` (pulsing dot) types; all contextual colors; small size variant.

```
use Ease\TWB5\Spinner;

echo (new Spinner())->draw();                            // default border, primary
echo (new Spinner('grow', 'success', 'sm'))->draw();    // small growing dot, green
```

### SubmitButton.php

[](#submitbuttonphp)

- **Functionality**: Bootstrap-styled form submit button.
- **Features**: Supports all button variants.

```
use Ease\TWB5\SubmitButton;

$submit = new SubmitButton('Save changes', 'primary');
echo $submit->draw();
```

### Table.php

[](#tablephp)

- **Functionality**: Create Bootstrap-styled tables.
- **Features**: Pass class via properties for striped, bordered, hoverable, small, and dark variants.

```
use Ease\TWB5\Table;

$table = new Table([
    ['Name',        'Score'],
    ['Alice',       '95'],
    ['Bob',         '87'],
]);
echo $table->draw();
```

### Tabs.php

[](#tabsphp)

- **Functionality**: Bootstrap tab component.
- **Features**: Static tabs via `addTab()`; AJAX/dynamic content loading via `addAjaxTab()`; first tab active by default.

```
use Ease\TWB5\Tabs;

$tabs = new Tabs();
$tabs->addTab('Overview',  'Overview content here.',  true);
$tabs->addTab('Details',   'Details content here.');
$tabs->addAjaxTab('Live',  '/api/live-data');
echo $tabs->draw();
```

### Toast.php

[](#toastphp)

- **Functionality**: Bootstrap toast notification.
- **Features**: Header title, optional subtitle (e.g. timestamp), body content, autohide control.

```
use Ease\TWB5\Toast;

$toast = new Toast('Notification', 'Your file was saved.', 'Just now');
echo $toast->draw();

// Persistent (no auto-hide)
$toast = new Toast('Warning', 'Action required.', null, false);
echo $toast->draw();
```

### WebPage.php

[](#webpagephp)

- **Functionality**: Full Bootstrap page scaffold.
- **Features**: Manages the HTML skeleton and automatically includes Bootstrap CSS/JS via CDN.

```
use Ease\TWB5\WebPage;
use Ease\TWB5\Container;

$page = new WebPage('My Web Page');
$page->addItem(new Container('Main content goes here.'));
echo $page->draw();
```

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

[](#installation)

```
composer require vitexsoftware/ease-twbootstrap5
```

Or add to `composer.json` manually:

```
{
    "require": {
        "vitexsoftware/ease-twbootstrap5": "^1.0"
    }
}
```

Then include the autoloader:

```
require 'vendor/autoload.php';
```

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance65

Regular maintenance activity

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~80 days

Total

4

Last Release

383d ago

Major Versions

0.1.0 → 1.0.02024-11-18

### Community

Maintainers

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

---

Top Contributors

[![Vitexus](https://avatars.githubusercontent.com/u/2621130?v=4)](https://github.com/Vitexus "Vitexus (110 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (19 commits)")[![antonKorban](https://avatars.githubusercontent.com/u/90313555?v=4)](https://github.com/antonKorban "antonKorban (2 commits)")[![kirtapos](https://avatars.githubusercontent.com/u/96991944?v=4)](https://github.com/kirtapos "kirtapos (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vitexsoftware-ease-twbootstrap5/health.svg)

```
[![Health](https://phpackages.com/badges/vitexsoftware-ease-twbootstrap5/health.svg)](https://phpackages.com/packages/vitexsoftware-ease-twbootstrap5)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.0k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

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

291.8k](/packages/webkinder-sproutset)[awkwardideas/switchblade

Extended blade directives for laravel

102.1k](/packages/awkwardideas-switchblade)

PHPackages © 2026

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