PHPackages                             hk2/addbootstrap5 - 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. hk2/addbootstrap5

ActiveMagento2-module

hk2/addbootstrap5
=================

Magento 2 extension that enables administrators to load Bootstrap 4 or Bootstrap 5 on the storefront without modifying theme files or creating child themes.

2.1.0(1y ago)15911OSL-3.0PHPPHP ^7.3.0|^7.4.0|^8.0|^8.1.0|^8.2.0

Since Jun 15Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/basantmandal/magento2-hk2-bootstrap5-module)[ Packagist](https://packagist.org/packages/hk2/addbootstrap5)[ RSS](/packages/hk2-addbootstrap5/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

HK2 AddBootstrap5 for Magento 2
===============================

[](#hk2-addbootstrap5-for-magento-2)

[![Version](https://camo.githubusercontent.com/e2367100cba06fb4b49ccbd7f8af46d40475360ed7a8848eb3865ba62c16ba65/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75653f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/e2367100cba06fb4b49ccbd7f8af46d40475360ed7a8848eb3865ba62c16ba65/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75653f7374796c653d666f722d7468652d6261646765)[![Website](https://camo.githubusercontent.com/ac8e0c230dc3e78c7d70b2215a8c1a1518802e9c29db9e4b3d079bad66ecd0c3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f776562736974652d3030303f7374796c653d666f722d7468652d6261646765)](https://www.basantmandal.in/)[![LinkedIn](https://camo.githubusercontent.com/1c83d60824b029ddbca838eefa03286957b4c8f622ab322b8ff5ee04c4676cac/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c696e6b6564696e2d3041363643323f7374796c653d666f722d7468652d6261646765266c6f676f3d6c696e6b6564696e)](https://www.linkedin.com/in/basantmandal/)

---

Overview
--------

[](#overview)

**HK2 AddBootstrap5** is a Magento 2 extension that enables administrators to load **Bootstrap 4 or Bootstrap 5** on the storefront **without modifying theme files or creating child themes**.

The extension is designed for:

- CMS content styling
- Third-party frontend integrations
- Rapid UI prototyping

All assets are injected using Magento’s standard layout and page configuration mechanisms, ensuring upgrade safety and compatibility with Magento 2.4.x.

> ⚠ **Important:**For manual installation, the **HK2 Core** package (`hk2/core`) must be installed first.

---

Key Features
------------

[](#key-features)

- **Bootstrap Version Selection**Supports Bootstrap **4.x** and **5.x** (including 5.3).
- **Admin-Controlled Enablement**Enable or disable Bootstrap loading from the Magento Admin Panel.
- **CDN-Based Asset Loading**Loads Bootstrap assets from trusted CDN providers for optimal performance.
- **Optional Debug Mode**Outputs non-intrusive diagnostic information to the browser console.
- **Demo Pages Included**Frontend demo routes are provided to verify correct integration.
- **No Theme Overrides**Uses Magento’s PageConfig and layout system—no template or theme modifications.
- **Non-Intrusive Design**Does not alter Magento core styles or UI components.

---

System Requirements
-------------------

[](#system-requirements)

- **Magento Open Source / Adobe Commerce:** 2.4.x
- **PHP:** 8.1 or higher
- **Database:** MySQL 8.0 / MariaDB 10.4+
- **Dependency:** `hk2/core` v1.0+ (required)

> Magento 2.3.x is end-of-life and not supported.

---

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

[](#installation)

### Composer (Recommended)

[](#composer-recommended)

From the Magento root directory:

```
composer require hk2/addbootstrap5
```

This automatically installs the required **HK2 Core** dependency.

---

### Manual Installation

[](#manual-installation)

1. Install **HK2 Core**:

```
app/code/HK2/Core
```

1. Create the module directory:

```
app/code/HK2/AddBootstrap5
```

1. Copy the module files into the directory.

---

### Enable the Module

[](#enable-the-module)

```
php bin/magento module:enable HK2_AddBootstrap5
php bin/magento setup:upgrade
php bin/magento cache:flush
```

Optional (production mode):

```
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
```

---

Configuration
-------------

[](#configuration)

Navigate to:

**Stores → Configuration → HK2 → AddBootstrap5**

### Available Options

[](#available-options)

SettingDescriptionEnable ExtensionEnable or disable Bootstrap injectionBootstrap VersionSelect Bootstrap 4.x or 5.xCDN ProviderChoose the CDN sourceDebug ModeOutput diagnostic logs to browser console---

Demo Pages
----------

[](#demo-pages)

Admin-visible demo links are included for validation.

Frontend demo routes:

**Bootstrap 5**

```
https://yourstore.com/bootstrap5demo/demo/index/version/5
```

**Bootstrap 4**

```
https://yourstore.com/bootstrap5demo/demo/index/version/4
```

> Demo routes are intended for testing and can be disabled in production.

---

Frontend Asset Injection
------------------------

[](#frontend-asset-injection)

When enabled, the extension registers:

- Bootstrap CSS (CDN)
- Bootstrap JavaScript bundle (CDN)
- Optional debug JavaScript (RequireJS-based)

All assets are injected using Magento’s PageConfig system and are **production-safe and CSP-compliant**.

---

Content Security Policy (CSP)
-----------------------------

[](#content-security-policy-csp)

This extension includes a `csp_whitelist.xml` configuration compatible with Magento 2.4.x.

The module **does not use**:

- Inline JavaScript
- `unsafe-inline`
- `unsafe-eval`

### Allowed Directives

[](#allowed-directives)

- `script-src`
- `style-src`
- `font-src`
- `connect-src`
- `img-src`

Only trusted CDN sources are permitted.

---

Privacy &amp; Data Usage
------------------------

[](#privacy--data-usage)

- No personal data is collected, stored, or transmitted
- No tracking, analytics, or background requests
- External requests are limited to configured CDN assets only

This extension is **fully GDPR-safe by design**.

---

Compatibility &amp; Performance
-------------------------------

[](#compatibility--performance)

- Compatible with Magento 2.4.x frontend architecture
- Safe for production mode
- Compatible with static content deployment
- No impact on checkout or admin performance

---

Known Limitations
-----------------

[](#known-limitations)

- The module does **not restyle Magento UI components**
- Any styling conflicts must be handled at the theme or CMS level
- Bootstrap JavaScript components require proper markup to function

---

Support &amp; Contribution
--------------------------

[](#support--contribution)

Contributions are welcome:

1. Fork the repository
2. Create a feature branch
3. Commit and push your changes
4. Open a pull request

Support availability may vary.

---

Disclaimer
----------

[](#disclaimer)

This extension is provided **as-is**, without warranty of any kind. The author is not liable for damages resulting from the use of this module.

---

License
-------

[](#license)

**Open Software License (OSL-3.0)**

---

Author
------

[](#author)

**Basant Mandal**HK2 – Hash Tag Kitto

- Website:
- LinkedIn:
- Email:

---

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance64

Regular maintenance activity

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

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

Total

3

Last Release

509d ago

Major Versions

1.0.0 → 2.0.02023-08-09

PHP version history (2 changes)1.0.0PHP ^7.3.0|^7.4.0|^8.0|^8.1.0

2.0.0PHP ^7.3.0|^7.4.0|^8.0|^8.1.0|^8.2.0

### Community

Maintainers

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

---

Top Contributors

[![basantmandal](https://avatars.githubusercontent.com/u/69835601?v=4)](https://github.com/basantmandal "basantmandal (46 commits)")

---

Tags

bootstrapbootstrap5magento2moduleextensionmagento2bootstrap 4bootstrap-5HK2BasantHK2\_AddBootstrap5basantmandal.in

### Embed Badge

![Health badge](/badges/hk2-addbootstrap5/health.svg)

```
[![Health](https://phpackages.com/badges/hk2-addbootstrap5/health.svg)](https://phpackages.com/packages/hk2-addbootstrap5)
```

###  Alternatives

[rafaelcg/magento2-quicklink

Faster subsequent page-loads by prefetching in-viewport links during idle time

5115.9k](/packages/rafaelcg-magento2-quicklink)[opengento/module-webapi-logger

This module allows you to analyze all the webapi rest done call toward your Magento.

1014.9k](/packages/opengento-module-webapi-logger)

PHPackages © 2026

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