The Sidr widget is a wrapper for the Sidr jQuery plugin, for creating side menus.

Installs: 3 424

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 4

Forks: 1

Open Issues: 0


1.0.0 2015-02-04 16:48 UTC

This package is not auto-updated.

Last update: 2024-07-10 07:11:14 UTC


The Sidr widget is a wrapper around the Sidr jQuery plugin, for creating side menus and "the easiest way for doing your menu responsive".


The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist raoul2000/yii2-sidr-widget "*"

or add

"raoul2000/yii2-sidr-widget": "*"

to the require section of your composer.json file.


Using Sidr widget is easy. For example :

use raoul2000\widget\sidr\SidrAsset;
use raoul2000\widget\sidr\Sidr;

// The Sidr plugin comes with 2 built-in theme : 'dark' and 'light'
// In this example we will use the light theme

SidrAsset::$theme = SidrAsset::THEME_LIGHT;

<!-- This button will open/close the side menu -->
<button id="open-menu">open/close Menu</button>

<!-- This is the menu header and content -->
<header id="demoheader">
	<h1>Demos &amp; Usage</h1>

<div id="demo-content">
		Lorem ipsum dolor sit amet, consectetur adipisicing elit.
		 Quasi nihil ab possimus temporibus 
		illum ullam molestiae aliquam maiores .

<!-- include the Sidr Widget -->
<?= Sidr::widget([
	'selector' => '#open-menu',
	'pluginOptions' => [
		'name' =>  'sidr-menu',
		'source' => '#demoheader, #demo-content',
		'onClose' => new yii\web\JsExpression('
			function() {
				alert("bye bye side menu !");
]); ?>

For more information on the plugin options, please refer to Sidr github page.



yii2-sidr-widget is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.