PHPackages                             jesspinkman/bs-pure - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jesspinkman/bs-pure

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jesspinkman/bs-pure
===================

Bootstrap extension to Pure library

1.0.2(4y ago)033MITPHPPHP ^8.0

Since Mar 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/JessPinkman/BSPure)[ Packagist](https://packagist.org/packages/jesspinkman/bs-pure)[ RSS](/packages/jesspinkman-bs-pure/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (16)Used By (0)

BSPure
======

[](#bspure)

This is a Bootstrap extension of the Library [Pure](https://github.com/JessPinkman/Pure).

- Create reusable Bootstrap components and layouts.
- Easily use all Bootstrap utilities on any component.
- Reduce lines of code.
- Easier Typing (autocompletion, docblock documentation, type hints, ...).

3 Factories and 1 Base Component
================================

[](#3-factories-and-1-base-component)

Whereas [Pure\\Pure](https://github.com/JessPinkman/Pure) outputs 'Pure\\Component' instances, BSPure factories output 'BSPure\\Components\\BSBaseComponent' instances. BSBaseComponent instances have access to bootstrap utilities.

BSPure::{tag}
-------------

[](#bspuretag)

BSPure class is a low level factory, use it to create any DOM elements with any html tag.

```
BSPure::div()->bg('primary', true)->m(5, 2)('Hello World');
```

```
Hello World
```

It also offers some core functions such as loading Boostrap stylesheets/scripts via CDN.

```
BSPure::loader();
```

```

```

there is also some abstraction involved when calling specific tags, such as 'head', which adds the necessary meta tags for bootstrap.

```
BSPure::head()(
  BSPure::title()('this is the page title')
);
```

```

  this is the page title

```

BSComponent::{component}
------------------------

[](#bscomponentcomponent)

This is the factory to create Boostrap core components (accordions, buttons, modals, carousels ...).

```
BSComponent::button('alert')('CLICK HERE');
```

```
CLICK HERE
```

BSLayout::{layout}
------------------

[](#bslayoutlayout)

This is the factory to create Boostrap layout components (col, row, container).

```
BSComponent::col(5, 'md-3')('This is a column');
```

```
This is a column
```

PAGE EXAMPLE
============

[](#page-example)

Here is an example of a basic page. With a responsive navbar [how it looks on codepen](https://codepen.io/JessPinkman/full/wvoRzVd)

```
$base_url = 'https://github.com/JessPinkman/';

BSPure::html()(
    BSPure::head()(
        BSPure::title('BSPure'),
        BSPure::loader()
    ),
    BSPure::body()(
        BSComponent::navBar()->expand('lg')->variant('dark')->bg('dark')->sticky()(
            BSComponent::navBarBrand()->href($base_url)('JessPinkman'),
            BSComponent::navBarToggler('#menu'),
            BSComponent::navBarCollapse('menu')->justifyContent('end')(
                BSComponent::navBarNav()(
                    BSComponent::navLink('/')('HOME'),
                    BSComponent::navLink('/products')('CATALOGUE')
                )
            )
        ),
        BSLayout::container('fluid')->h(100, true)->d('flex')->alignItems('center')->justifyContent('center')(
            BSPure::a()->href('https://github.com/JessPinkman/BSPure')(
                BSComponent::button('danger')->rounded('pill')->p(5, 2)->shadow()(
                    BSPure::h1()('BSPure')
                )
            )
        ),
    )
);
```

BSPURE character count: **930**

```
>

        BSPure

                BSPure

                        HOME
                        CATALOGUE

                    BSPure

```

HTML character count: **1831**

Object Oriented
---------------

[](#object-oriented)

Because BSPure revolves around objects, the possibilities are endless. Inheritance, composition, loops, strict typing, etc ...

```
/**
 * Custom factory to create app components
 */
class AppComponentFactory extends BSComponent
{
    /**
     * Make a reusable component to create uniform buttons.
     *
     * Added classes: btn-warning rounded-pill px-3 py-1 m-3
     */
    public static function appButton(string $label): BSBaseComponent
    {
        return parent::button('warning')
            ->rounded('pill')
            ->p(3, 1)
            ->m(3)
            ->___($label);
    }
}

echo AppComponentFactory::appButton('BUY NOW');
```

```
BUY NOW
```

Full Page
=========

[](#full-page)

rendered in [codepen](https://codepen.io/JessPinkman/full/zYoyZaL?editors=1000)

```
$git_url = 'https://github.com/JessPinkman/';
$pure = $git_url . 'Pure';
$BSpure = $git_url . 'BSPure';
$bootstrap = 'https://getbootstrap.com/docs/5.0/getting-started/introduction/';

BSPure::html()(
    BSPure::head()(
        BSPure::title('BSPure'),
        BSPure::loader()
    ),
    BSPure::body()(
        BSComponent::navBar()->variant('dark')->expand('lg')->bg('success', true)->sticky()->shadow('sm')(
            BSComponent::navBarBrand()->href($git_url)('JessPinkman'),
            BSComponent::navBarToggler('#menu'),
            BSComponent::navBarCollapse('menu')->justifyContent('end')->m(5, 0)(
                BSComponent::navBarNav()->gap(2)(
                    BSComponent::navLink($pure)->target('_blank')('Pure'),
                    BSComponent::navLink($BSpure)->target('_blank')('BSPure'),
                    BSComponent::navLink($bootstrap)->target('_blank')('Bootstrap'),
                )
            )
        ),
        BSLayout::container('fluid')->text('center')->gap(5)->flexColumn()->d('flex')->p(5)(
            BSPure::h1()("Visit the git repos !"),
            BSLayout::row('fluid')->gap(5)->p(5)(
                BSLayout::col('lg')(
                    BSComponent::card()->text('start')->shadow()(
                        BSComponent::cardHeader()->colors('light', 'dark')('Pure'),
                        BSComponent::cardBody()(
                            BSPure::h6()('Library to create, use and reuse components to generate html'),
                            BSPure::ul()(
                                BSPure::li()('Combine elements freely and seamlessly.'),
                                BSPure::li()('Easily add attributes to any element with the use of magic __call.'),
                                BSPure::li()('Create structures that you can interact with by extending the class'),
                                BSPure::li()('Make your code shorter, clean, and readable.'),
                            ),
                            BSComponent::cardLink($pure)->target('_blank')->stretchedLink()
                        )
                    )
                ),
                BSLayout::col('lg')(
                    BSComponent::card()->text('start')->shadow()(
                        BSComponent::cardHeader()->colors('light', 'dark')('BSPure'),
                        BSComponent::cardBody()(
                            BSPure::h6()('This is a Bootstrap extension of the Library Pure'),
                            BSPure::ul()(
                                BSPure::li()('Create reusable Bootstrap components and layouts.'),
                                BSPure::li()('Easily use all Bootstrap utilities on any component.'),
                                BSPure::li()('Reduce lines of code.'),
                                BSPure::li()('Easier Typing (autocompletion, docblock documentation, type hints, ...)
                                '),
                            ),
                            BSComponent::cardLink($BSpure)->target('_blank')->stretchedLink()
                        )
                    )
                ),
            ),
        ),
        BSPure::div()->text('center')(
            BSComponent::button('info')
                ->targetModal('modal')
                ->text('light')
                ->rounded('pill')
                ->p(5, 2)
                ->shadow()
                ->___(
                    BSPure::h1()('show me')
                ),
            BSComponent::modal('modal')->fade()->centered()(
                BSComponent::modalBody()->rounded()->border(0)->text('start')(
                    BSPure::code()('BSComponent::alert("danger")->text("center")("Alert");'),
                    BSPure::br(),
                    BSPure::code()('BSComponent::alert("success")->text("center")("SAVED !");'),
                    BSPure::br(),
                    BSComponent::alert('danger')->text('center')->m(0, 1)("Alert"),
                    BSComponent::alert('success')->text('center')->m(0, 1)("SAVED !"),
                    BSPure::hr(),
                    BSPure::code()('BSComponent::spinner(true)->text("warning");'),
                    BSPure::br(),
                    BSPure::code()('BSComponent::spinner(true)->text("danger");'),
                    BSPure::br(),
                    BSPure::code()('BSComponent::spinner(true)->text("success");'),
                    BSPure::br(),
                    BSPure::code()('BSComponent::spinner(false)->text("warning");'),
                    BSPure::br(),
                    BSPure::code()('BSComponent::spinner(false)->text("danger");'),
                    BSPure::br(),
                    BSPure::code()('BSComponent::spinner(false)->text("success");'),
                    BSPure::br(),
                    BSComponent::spinner(true)->text('warning'),
                    BSComponent::spinner(true)->text('danger'),
                    BSComponent::spinner(true)->text('success'),
                    BSComponent::spinner(false)->text('warning'),
                    BSComponent::spinner(false)->text('danger'),
                    BSComponent::spinner(false)->text('success'),
                    BSPure::hr(),
                    BSPure::code()('BSComponent::progress(30);'),
                    BSPure::br(),
                    BSPure::code()('BSComponent::progress(80);'),
                    BSComponent::progress(30)->m(0, 1),
                    BSComponent::progress(80)->m(0, 1),
                )
            )
        ),
    )
);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Recently: every ~18 days

Total

15

Last Release

1810d ago

Major Versions

0.2.0 → 1.0.02021-05-26

PHP version history (5 changes)0.0.1PHP ^7.2

0.0.4PHP ^7.3

0.0.6PHP ^7.4

0.0.9PHP ^7.4 | ^8.0

1.0.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34494151?v=4)[jesspinkman](/maintainers/jesspinkman)[@JessPinkman](https://github.com/JessPinkman)

---

Top Contributors

[![JessPinkman](https://avatars.githubusercontent.com/u/34494151?v=4)](https://github.com/JessPinkman "JessPinkman (35 commits)")

### Embed Badge

![Health badge](/badges/jesspinkman-bs-pure/health.svg)

```
[![Health](https://phpackages.com/badges/jesspinkman-bs-pure/health.svg)](https://phpackages.com/packages/jesspinkman-bs-pure)
```

###  Alternatives

[adigital/help-links

Define useful links to be added to the dashboard for clients.

102.0k](/packages/adigital-help-links)

PHPackages © 2026

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