PHPackages                             kartik-v/yii2-context-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. kartik-v/yii2-context-menu

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

kartik-v/yii2-context-menu
==========================

A context menu extension for Yii framework 2.0

v1.2.4(4y ago)9182.9k↓21.6%5BSD-3-ClausePHP

Since Oct 5Pushed 4y ago4 watchersCompare

[ Source](https://github.com/kartik-v/yii2-context-menu)[ Packagist](https://packagist.org/packages/kartik-v/yii2-context-menu)[ Docs](https://github.com/kartik-v/yii2-context-menu)[ RSS](/packages/kartik-v-yii2-context-menu/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

 [ ![Krajee Logo](https://camo.githubusercontent.com/4addfbb3869c3fc7d79befea4f06d9cf3655a686fb503df0da1d725859cfdef9/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f6b72616a65652d6c6f676f2d622e706e67) ](http://demos.krajee.com "Krajee Demos")
 yii2-context-menu ---

 [ ![Donate](https://camo.githubusercontent.com/4af77d425ca202e55ab3d711b438e238ded194735bc345a019ac060e03e26227/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67) ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal")
=====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------yii2-context-menu--------------------)

[![Stable Version](https://camo.githubusercontent.com/5bee218ae4f9f1afcc85c830496db053e230483bb204774ca361e8b9a60443a9/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d636f6e746578742d6d656e752f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-context-menu)[![Unstable Version](https://camo.githubusercontent.com/a6b57fd0744f7b9aa9b4698b82dbe6e2fbcc98822b77e60526be6e1195753f31/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d636f6e746578742d6d656e752f762f756e737461626c65)](https://packagist.org/packages/kartik-v/yii2-context-menu)[![License](https://camo.githubusercontent.com/6cceb8aa16b1c88299f446b56c225eef6741fe2ab50108c246dd9e18d9ffa5c0/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d636f6e746578742d6d656e752f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-context-menu)[![Total Downloads](https://camo.githubusercontent.com/cf95287828e329cb9b23263d2b710514594b752b4508b3cb10a07f8582625c0b/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d636f6e746578742d6d656e752f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-context-menu)[![Monthly Downloads](https://camo.githubusercontent.com/a0427aa6a880116f223abdc14bdfb206d1c42c8eaa0b7ba787c83a987015f2b0/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d636f6e746578742d6d656e752f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-context-menu)[![Daily Downloads](https://camo.githubusercontent.com/962ff823ba35ec6c9226031691e754b4579c18be4b844aaa2024ad3d2769ba32/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d636f6e746578742d6d656e752f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-context-menu)

A context menu extension for Yii framework 2.0 that allows you to add and render a context menu to any element on the page. A context menu is a pop up menu that one initiates on any element by right clicking the mouse in that target element. This widget is a wrapper for the [bootstrap-contextmenu plugin](https://github.com/sydcanem/bootstrap-contextmenu) which is styled for multiple Bootstrap versions (3.x, 4.x, and 5.x). The widget uses the `\yii\bootstrap\Dropdown` or `\kartik\bs4dropdown\Dropdown` widget to generate a dropdown menu.

### Demo

[](#demo)

You can see detailed [documentation](http://demos.krajee.com/context-menu) on usage of the extension.

Latest Release
--------------

[](#latest-release)

Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-context-menu/blob/master/CHANGE.md) for details on changes to various releases.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

> Note: Check the [composer.json](https://github.com/kartik-v/yii2-context-menu/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

Either run

```
$ php composer.phar require kartik-v/yii2-context-menu "dev-master"

```

or add

```
"kartik-v/yii2-context-menu": "dev-master"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

### ContextMenu

[](#contextmenu)

```
use kartik\cmenu\ContextMenu;
ContextMenu::begin([
    'items' => [
        ['label' => 'Action', 'url' => '#'],
        ['label' => 'Another action', 'url' => '#'],
        ['label' => 'Something else here', 'url' => '#'],
        '',
        ['label' => 'Separated link', 'url' => '#'],
    ],
]);
// fill in any content within your target container
ContextMenu::end();
```

License
-------

[](#license)

**yii2-context-menu** is released under the BSD-3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community11

Small or concentrated contributor base

Maturity68

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

Recently: every ~618 days

Total

7

Last Release

1720d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3592619?v=4)[Kartik Visweswaran](/maintainers/kartik-v)[@kartik-v](https://github.com/kartik-v)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (31 commits)")

---

Tags

Contextmenuyii2extensionwidgetmouseclick

### Embed Badge

![Health badge](/badges/kartik-v-yii2-context-menu/health.svg)

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

###  Alternatives

[kartik-v/yii2-nav-x

An extended bootstrap Nav widget for Yii 2 with submenu drilldown.

27564.8k6](/packages/kartik-v-yii2-nav-x)[kartik-v/yii2-dropdown-x

An extended bootstrap 3.x dropdown widget for Yii 2 with submenu drilldown.

16842.3k6](/packages/kartik-v-yii2-dropdown-x)[kartik-v/yii2-grid

Yii 2 GridView on steroids. Various enhancements and utilities for the Yii 2.0 GridView widget.

5576.6M179](/packages/kartik-v-yii2-grid)[kartik-v/yii2-widget-sidenav

An enhanced side navigation menu styled for bootstrap (sub repo split from yii2-widgets)

364.0M8](/packages/kartik-v-yii2-widget-sidenav)[kartik-v/yii2-widget-datetimepicker

Enhanced Yii2 wrapper for the bootstrap datetimepicker plugin (sub repo split from yii2-widgets)

1036.5M47](/packages/kartik-v-yii2-widget-datetimepicker)[kartik-v/yii2-widget-typeahead

Enhanced Yii2 wrapper for the Twitter Typeahead plugin (sub repo split from yii2-widgets).

454.8M9](/packages/kartik-v-yii2-widget-typeahead)

PHPackages © 2026

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