Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matej-ch/yii2-sidebar-collapsible
Collapsible sidebar for yii2 apps
https://github.com/matej-ch/yii2-sidebar-collapsible
collapse collapsible sidebar yii2 yii2-widget
Last synced: 4 days ago
JSON representation
Collapsible sidebar for yii2 apps
- Host: GitHub
- URL: https://github.com/matej-ch/yii2-sidebar-collapsible
- Owner: Matej-ch
- Created: 2022-04-10T11:50:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-11T16:24:01.000Z (over 2 years ago)
- Last Synced: 2024-12-15T06:47:54.725Z (about 1 month ago)
- Topics: collapse, collapsible, sidebar, yii2, yii2-widget
- Language: PHP
- Homepage:
- Size: 109 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Collapsible sidebar widget
====================
Sidebar widget you can add to your page with your own custom contentInstallation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist matejch/yii2-sidebar-collapsible "^1.0.1"
```or add
```
"matejch/yii2-sidebar-collapsible": "^1.0.1"
```to the require section of your `composer.json` file.
Setup
-----
-----#### Elements with **[data-sidebar-hide]** will be hidden when sidebar is collapsed
Example
```html
This text is shown only when sidebar is not collapsed
```-----
#### Elements with **[data-sidebar-collapsible]** will update their left padding when is sidebar size has changed
Example
```html
```### Sidebar example with custom content
```php
'Collapse', // Optional text in button, defaults to Collapse
'top' => '75px', //Optional Fixed top, where sidebar begins, defaults to 0px
'left' => '0px', //Optional Fixed left, where sidebar begins on letf side, defaults to 0px
//'sidebarCacheName' => 'test', //Optional Name for saving state in localstorage
'widthOpen' => '256px', //Optional size when sidebar is opened
'widthCollapsed' => '70px', //Optional size when sidebar is colapsed
'topMobile' => '0px', //Optional
'leftMobile' => '0px', //Optional
'position' => 'fixed', //Optional
'positionMobile' => 'fixed' //Optional
]) ?>
= Html::a(' text will hide on collapse', '#', ['class' => "btn btn-danger"]) ?>
= Html::a(' text will hide on collapse', '#', ['class' => "btn btn-primary"]) ?>
= Html::a(' text will hide on collapse', '#', ['class' => "btn btn-success"]) ?>
= Html::a(' text will hide on collapse','#', ['class' => "btn btn-warning"]) ?>```