PHPackages                             nasirkhan/laravel-cube - 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. nasirkhan/laravel-cube

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

nasirkhan/laravel-cube
======================

A unified component library for Laravel applications supporting both Tailwind CSS (with Flowbite) and Bootstrap frameworks

v2.6.0(1mo ago)21.3k21GPL-3.0-or-laterBladePHP ^8.3CI passing

Since Feb 10Pushed 1mo agoCompare

[ Source](https://github.com/nasirkhan/laravel-cube)[ Packagist](https://packagist.org/packages/nasirkhan/laravel-cube)[ Docs](https://github.com/nasirkhan/laravel-cube)[ RSS](/packages/nasirkhan-laravel-cube/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (20)Versions (15)Used By (1)

Laravel Cube
============

[](#laravel-cube)

[![Laravel Cube - A versatile collection of reusable UI components for Laravel applications, supporting Tailwind CSS and Bootstrap 5](https://camo.githubusercontent.com/e262e57cb448a6485bda86614e20c3aefcb7a536759937edc4e6cdd5ecd7a535/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f64736c6731666338792f696d6167652f75706c6f61642f76313737343638343931362f6c61726176656c5f637562655f7061636b6167655f6c6f676f5f7a38787161612e6a7067)](https://camo.githubusercontent.com/e262e57cb448a6485bda86614e20c3aefcb7a536759937edc4e6cdd5ecd7a535/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f64736c6731666338792f696d6167652f75706c6f61642f76313737343638343931362f6c61726176656c5f637562655f7061636b6167655f6c6f676f5f7a38787161612e6a7067)

A versatile collection of reusable UI components for Laravel applications with **dual framework support** - use Tailwind CSS or Bootstrap 5 seamlessly.

This package is used in [Laravel Starter](https://github.com/nasirkhan/laravel-starter) though it is framework-agnostic and can be dropped into any Laravel app.

[![Latest Version on Packagist](https://camo.githubusercontent.com/45f5f9f72e287775b66911e8912aa600d2a23cbffe07326c19cc19783398d792/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e617369726b68616e2f6c61726176656c2d637562652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nasirkhan/laravel-cube)[![Total Downloads](https://camo.githubusercontent.com/cbcf0f6326f728bb79ef81be48d1c8d91c6116cea0e347c771908c1caa9b52a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e617369726b68616e2f6c61726176656c2d637562652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nasirkhan/laravel-cube)[![StyleCI](https://camo.githubusercontent.com/9058ed9a3d373800c2001867e51049e8d3463c5881d6274335d01a1ca9a7e1c1/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f313135343737363035322f736869656c643f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.styleci.io/repos/1154776052)

Features
--------

[](#features)

- **Dual Framework Support** - Use Tailwind CSS (Flowbite) or Bootstrap 5
- **Framework Switching** - Change frameworks per component or globally
- **Reusable Components** - UI, forms, navigation, and utility components
- **Dark Mode** - Built-in dark mode support for Tailwind-based components
- **Livewire Compatible** - Works well with Livewire 3/4
- **Customizable** - Override styles, extend functionality, publish views
- **Companion Friendly** - Designed to work well with companion packages such as `nasirkhan/laravel-sharekit`

Why "Cube"?
-----------

[](#why-cube)

The cube represents versatility and multidimensionality - just like this package that adapts to your framework choice while keeping a unified Blade component API.

Companion Packages
------------------

[](#companion-packages)

Laravel Cube focuses on shared UI foundations.

For page-level social sharing buttons, use the companion package:

- [`nasirkhan/laravel-sharekit`](https://github.com/nasirkhan/laravel-sharekit) - reusable social sharing buttons with metadata auto-detection, popup sharing, copy link support, and page-scoped assets

That keeps Cube focused on core UI primitives while optional frontend behavior can evolve separately.

Components Included
-------------------

[](#components-included)

### UI Components

[](#ui-components)

- **Button** - ``
- **Modal** - ``
- **Card** - ``
- **Badge** - ``
- **Icon** - ``
- **Footer Credit** - ``
- **Footer License** - ``

### Utility Components

[](#utility-components)

- **Google Analytics** - ``

### Form Components

[](#form-components)

- ``
- ``
- ``
- ``
- ``
- ``
- ``
- ``

### Navigation Components

[](#navigation-components)

- ``
- ``
- ``
- ``

Requirements
------------

[](#requirements)

- PHP ^8.3
- Laravel ^11.0 || ^12.0 || ^13.0
- Tailwind CSS or Bootstrap 5
- Livewire ^3.0 || ^4.0 for Livewire-powered applications

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

[](#installation)

```
composer require nasirkhan/laravel-cube
```

Flowbite Blade Icons is installed automatically as a dependency of Laravel Cube.

The package will automatically register its service provider.

### Configuration

[](#configuration)

Set your default framework in `.env`:

```
CUBE_FRAMEWORK=tailwind
```

or

```
CUBE_FRAMEWORK=bootstrap
```

### Tailwind CSS Setup

[](#tailwind-css-setup)

If you are using **Tailwind CSS v4**, import the package CSS source file so Tailwind can detect utility classes used inside Cube views.

Add this to your application stylesheet:

```
@import "../../vendor/nasirkhan/laravel-cube/resources/css/tailwind.css";
```

This step is not required for Bootstrap projects.

### Optional Publishing

[](#optional-publishing)

Publish the configuration file:

```
php artisan vendor:publish --tag=cube-config
```

Publish the views:

```
php artisan vendor:publish --tag=cube-views
```

Usage
-----

[](#usage)

### Global Framework Selection

[](#global-framework-selection)

```
CUBE_FRAMEWORK=tailwind
```

### Per Component Framework Override

[](#per-component-framework-override)

```

    Bootstrap Button

    Tailwind Button

```

### Basic Examples

[](#basic-examples)

#### Buttons

[](#buttons)

```
Save
Delete
Cancel
Processing...
```

#### Icons

[](#icons)

```

```

See icon documentation in `docs/icons.md`.

#### Form Group

[](#form-group)

```

```

#### Navigation

[](#navigation)

```

    Dashboard

```

#### Google Analytics

[](#google-analytics)

```

```

Using Laravel Sharekit Alongside Cube
-------------------------------------

[](#using-laravel-sharekit-alongside-cube)

If your app uses Cube for layout and UI, and needs social sharing only on selected pages, install Sharekit separately:

```
composer require nasirkhan/laravel-sharekit
```

Then use it where needed:

```

```

This works especially well when Cube is your shared UI package and Sharekit is an optional content-page feature.

Customization
-------------

[](#customization)

### Override Styles

[](#override-styles)

Publish the configuration and modify CSS classes:

```
php artisan vendor:publish --tag=cube-config
```

### Extend Components

[](#extend-components)

Publish the views and customize them inside:

`resources/views/vendor/cube/components/`

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email `nasir8891@gmail.com` instead of using the issue tracker.

Credits
-------

[](#credits)

- [Nasir Khan](https://github.com/nasirkhan)
- [All Contributors](../../contributors)

License
-------

[](#license)

The GNU General Public License v3.0 or later. Please see [LICENSE](LICENSE) for more information.

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance94

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.5% 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 ~9 days

Recently: every ~16 days

Total

13

Last Release

33d ago

Major Versions

v1.5.0 → v2.0.02026-03-22

PHP version history (2 changes)v1.0.0PHP ^8.2

v2.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/27802773a2668018fdca8b76c35d03ce16cfc92c0f9c6703fb532e77780eadc0?d=identicon)[nasirkhan](/maintainers/nasirkhan)

---

Top Contributors

[![nasirkhan](https://avatars.githubusercontent.com/u/396987?v=4)](https://github.com/nasirkhan "nasirkhan (66 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

blade-componentsbootstraplaravel-component-librarylaravel-componentstailwindcsslaravelcomponentstailwindbootstrapFormsnavigationalpineflowbiteblade-componentsui-componentscube

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nasirkhan-laravel-cube/health.svg)

```
[![Health](https://phpackages.com/badges/nasirkhan-laravel-cube/health.svg)](https://phpackages.com/packages/nasirkhan-laravel-cube)
```

###  Alternatives

[livewire/flux

The official UI component library for Livewire.

9527.8M128](/packages/livewire-flux)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725172.4k14](/packages/tallstackui-tallstackui)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M131](/packages/laravel-pulse)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[webwizo/laravel-shortcodes

Wordpress like shortcodes for Laravel 11, 12 and 13

217700.9k8](/packages/webwizo-laravel-shortcodes)

PHPackages © 2026

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