PHPackages                             rft/yii2-sidebar-menu - 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. rft/yii2-sidebar-menu

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

rft/yii2-sidebar-menu
=====================

A custom sidebar menu dependent widget for Yii2

v1.0.3(7mo ago)07MITPHP

Since Oct 12Pushed 7mo agoCompare

[ Source](https://github.com/zenjaku/yii2-sidebarmenu)[ Packagist](https://packagist.org/packages/rft/yii2-sidebar-menu)[ RSS](/packages/rft-yii2-sidebar-menu/feed)WikiDiscussions main Synced 1mo ago

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

Yii2 Sidebar Menu Widget
========================

[](#yii2-sidebar-menu-widget)

A customizable and responsive sidebar menu widget for Yii2 applications with collapsible functionality and nested submenus.

Features
--------

[](#features)

- **Collapsible Design** — Toggle between full and compact sidebar views
- **Nested Submenus** — Supports multi-level dropdown menus
- **Active State Management** — Automatically highlights active items
- **FontAwesome Icons** — Built-in icon support
- **Responsive &amp; Mobile-Friendly**
- **Customizable** — Easily extendable styles and logic

---

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

[](#installation)

### Option 1 — via Composer (recommended)

[](#option-1--via-composer-recommended)

Once published to Packagist:

```
composer require rft/yii2-sidebar-menu
```

Or if you are installing directly from GitHub:

```
composer require rft/yii2-sidebar-menu:dev-main
```

```
rft/sidebarmenu/
├── src/
│   ├── SidebarMenu.php
│   ├── SidebarMenuAssets.php
│   └── assets/
│       ├── css/sidebar-menu.css
│       └── js/sidebar-menu.js
├── composer.json
└── README.md

```

3. Add to your `composer.json` autoload (if manual install):

```
"autoload": {
    "psr-4": {
        "rft\\sidebarmenu\\": "src/"
    }
}
```

Then run:

```
composer dump-autoload
```

---

Usage Example
-------------

[](#usage-example)

In your Yii2 view file:

```
use rft\sidebarmenu\SidebarMenu;

echo SidebarMenu::widget([
    'title' => 'Main Menu',
    'imgSrc' => 'Sidebar logo',
    'navTitle' => 'Nav-header title',
    'items' => [
        ['label' => 'Dashboard', 'icon' => 'fa fa-home', 'url' => ['/site/index']],
        [
            'label' => 'Management',
            'icon' => 'fa fa-cog',
            'items' => [
                ['label' => 'Users', 'url' => ['/user/index']],
                ['label' => 'Roles', 'url' => ['/role/index']],
            ],
        ],
        ['label' => 'Settings', 'icon' => 'fa fa-cog', 'url' => ['/site/settings']],
    ],
]);
```

---

Menu Item Structure
-------------------

[](#menu-item-structure)

Each menu item can include the following keys:

| Key | Type | Description | | --------- | ------ | ---------------------------------- | ----------------------- | | `label` | string | Display name of the menu item | | `icon` | string | FontAwesome icon class (optional) | | `url` | array | string | The target route or URL | | `visible` | bool | Whether the item should be visible | | `items` | array | Nested submenu items (optional) |

---

Styling
-------

[](#styling)

The widget includes a default dark theme.
You can override styles via CSS variables or by extending the classes.

Example override:

```
.sidebar {
  --sidebar-bg: #0f172a;
  --sidebar-header-bg: #1e293b;
  --menu-hover-bg: #334155;
}
```

---

JavaScript Features
-------------------

[](#javascript-features)

- Sidebar toggle (collapse / expand)
- Auto-closing submenus when collapsed
- Expands sidebar when submenu clicked in collapsed state

---

Browser Support
---------------

[](#browser-support)

BrowserSupportedChrome✅Firefox✅Safari✅Edge✅---

License
-------

[](#license)

This widget is open-source software licensed under the **MIT License**.

---

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance65

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

Total

4

Last Release

211d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f08a3a28030a2a666f90fc3d463bef54d2a15bf56a69c311bb02ed629d0fe9c?d=identicon)[zenjaku](/maintainers/zenjaku)

---

Top Contributors

[![zenjaku](https://avatars.githubusercontent.com/u/172955298?v=4)](https://github.com/zenjaku "zenjaku (8 commits)")

---

Tags

yii2widgetsidebar

### Embed Badge

![Health badge](/badges/rft-yii2-sidebar-menu/health.svg)

```
[![Health](https://phpackages.com/badges/rft-yii2-sidebar-menu/health.svg)](https://phpackages.com/packages/rft-yii2-sidebar-menu)
```

###  Alternatives

[softark/yii2-dual-listbox

Bootstrap Dual Listbox Widget for Yii 2

20144.4k11](/packages/softark-yii2-dual-listbox)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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