PHPackages                             php-templates/bootstrap5 - 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. php-templates/bootstrap5

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

php-templates/bootstrap5
========================

Php Templates bootstrap5 components

1.0.0(3y ago)07MITHack

Since Dec 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/php-templates/bootstrap5)[ Packagist](https://packagist.org/packages/php-templates/bootstrap5)[ Docs](https://github.com/php-templates/bootstrap5)[ RSS](/packages/php-templates-bootstrap5/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Php Templates - Bootstrap5 components
-------------------------------------

[](#php-templates---bootstrap5-components)

### Instalation &amp; Setup

[](#instalation--setup)

- `composer require php-templates/bootstrap5`or
- download project and include `Bootstrap.php` file.

```
use PhpTemplates\Bootstrap;

$cfg = new Config('default', __DIR__);
$eventHolder = new EventHolder();
$viewFactory = new Template( __DIR__.'/results', $cfg, $eventHolder);

$bs = new Bootstrap;
$bs->mount($viewFactory);

```

Accordion
---------

[](#accordion)

### props

[](#props)

- `:items` - an associative array holding accordion-item::id =&gt; accordion-item::title
- `class` - extra classes to `.accordion`
- `toggle` - if true/no-value, prevent multiple items to be opened at same time
- `open` - true/no-value to render an accordion that’s expanded

### slots

[](#slots)

- add each accordion body under a slot with name coresponding to accordion-item::id

    ```

    ```

 lorem

 ipsum

``` will result:

```

        Lorem

        lorem

        Ipsum

        ipsum

```

Alert
-----

[](#alert)

### props

[](#props-1)

- `type` - bs5 theme colors (primary, secondary, etc)
- `title` - alert h4 title (optional)
- `dismiss` - display dismiss button
- `icon` - hide alert icon if false

### slots

[](#slots-1)

- `default` - alert message
- `title` - title override, if a complex one is needed
- `icon` - slot for icon

    ```

    ```

Aww yeah, you successfully read this important alert message

``` will result:

```

                Well done
        Aww yeah, you successfully read this important alert message

```

Badge
-----

[](#badge)

### props

[](#props-2)

- `v` - bs theme colors
- `class` - extra classes

### slots

[](#slots-2)

- `default` - text value of the badge

    ```

    ```

12

```

will result:

```

 12 ``` Breadcrumb
----------

[](#breadcrumb)

### props

[](#props-3)

- `:items` - an array holding items of form `['label'=>'Displayed', 'value'=>'href']`
- `class` - extra classes

    ```

    ```

``` will result:

```

            Home
              Product

```

Button
------

[](#button)

### props

[](#props-4)

- `v` - variant - primary, secondary, etc
- `class` - extra classes
- `href` - if given, it will render an anchor instead of button
- `size` - sm, lg (btn-\*)
- `disabled` - true/no value = disabled

    ```

    ```

OK OK

```

will result:

```

 OK [ OK ](yoo)``` Card
----

[](#card)

### props

[](#props-5)

- `header` - card header text
- `footer` - card footer text
- `img` - card image src
- `alt` - card image alt
- `class` - custom img class

### slots

[](#slots-3)

- `default` - .card-body content
- `header` - .card-header content
- `above` - above .card-body
- `below` - below .card-body
- `footer` - .card-footer content

    ```

    ```

 Sit amen ``` will result:

```

      Lorem

        Sit amen

      Ipsum

```

Dropdown
--------

[](#dropdown)

### props

[](#props-6)

- `type` - dropdown(default), dropup, dropstart, dropend
- `v` - primary, secondary, etc
- `size` - sm, md, lg, etc
- `id` - button id
- `label` - button text
- `ul_class` - list class
- `:items` - an array of items where item like \['type' =&gt; 'title,text,separator or item', 'text' =&gt; 'item text', 'href' =&gt; $optional, 'disabled' =&gt; $optional, 'active' =&gt; $optional, '\_attrs' =&gt; $optionalItemBinds\]

### slots

[](#slots-4)

- `default` - the dropdown content if custom content required
- `btn-inner` - button childnode

    ```

    ```

```

will result:

```

 Btn Label - ###### dd Title

    [](#dd-title)
- ---
- dd Text
- dd Item

``` Modal
-----

[](#modal)

### props

[](#props-7)

- `title` - modal title
- `fade` - if false, no fade effect applied
- `size` - sm, md, lg, etc
- `id` - modal id
- `class` - modal class
- `esc` - if should close on esc keypress
- `scrollable` - if modal is scrollable
- `centered` - if modal should be vertically centered

### slots

[](#slots-5)

- `default` - modal body
- `header` - .modal-header childNodes
- `footer` - .modal-footer childNodes

    ```

    ```

 modal body Btn ``` will result:

```

          Demo modal

            modal body

    Btn

```

Nav
---

[](#nav)

### props

[](#props-8)

- `:items` - an array holding items of form `['label'=>'Displayed', 'value'=>'href', 'disabled'=>$optional, 'active'=>$optional]`
- `class` - extra classes

    ```

    ```

```

will result:

```

- Lorem
- [ ipsum](sit)

``` Tabs
----

[](#tabs)

### props

[](#props-9)

- `:items` - associative array holding $tab\_id =&gt; $label
- `value` - selected tab by id
- `vertical` - if you want tabs to be vertical
- `class` - extra .nav-tabs classes
- `id` - .nav-tabs id
- `fade` - if false, no fade effect

### slots

[](#slots-6)

- one slot for each $tab\_id may be passed

    ```

    ```

lorem

ipsum

``` will result:

```

        Lorem

        Ipsum

         lorem

         ipsum

```

Offcanvas
---------

[](#offcanvas)

### props

[](#props-10)

- `pos` - .offcanvas position, default top
- `class` - .offcanvas extra classes
- `id` - .offcanvas id
- `scroll` - body scroll allowed or not
- `backdrop` - .offcanvas backdrop

### slots

[](#slots-7)

- default - offcanvas body child nodes

    ```

    ```

Toggle top offcanvas

 ... ``` will result:

```
Toggle top offcanvas

    Lorem Ipsum

      ...

```

Form group
----------

[](#form-group)

Create form-group structures in a single line using `b-form-group` tag. You can create input groups, prepends, appends, inline forms and column forms of any type.

### props

[](#props-11)

- `type` - text, textarea, checkbox, select, switch, etc...
- `class` - form-group extra class
- `size` - form-control size
- `options` - when type = select, an array of \[label=&gt;text,value=&gt;value\] structures
- `prepend` - prepend text
- `append` - append text
- p-bind is present on form-control to pass forward any extra attribute

### slots

[](#slots-8)

- prepend - prepend custom, if more then a text is needed
- append - append custom, if more then a text needed

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

1261d ago

### Community

Maintainers

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

---

Top Contributors

[![florin-botea](https://avatars.githubusercontent.com/u/59554192?v=4)](https://github.com/florin-botea "florin-botea (2 commits)")[![php-templates](https://avatars.githubusercontent.com/u/116520363?v=4)](https://github.com/php-templates "php-templates (1 commits)")

---

Tags

phptemplates

### Embed Badge

![Health badge](/badges/php-templates-bootstrap5/health.svg)

```
[![Health](https://phpackages.com/badges/php-templates-bootstrap5/health.svg)](https://phpackages.com/packages/php-templates-bootstrap5)
```

###  Alternatives

[endroid/qr-code-bundle

Endroid QR Code Bundle

32110.6M17](/packages/endroid-qr-code-bundle)[gamajo/template-loader

A class for your WordPress plugin, to allow loading template parts with fallback through the child theme &gt; parent theme &gt; plugin

29647.0k5](/packages/gamajo-template-loader)[devanych/view-renderer

Simple PHP View Renderer

153.2k1](/packages/devanych-view-renderer)

PHPackages © 2026

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