PHPackages                             toxor88/yii2-widget-switchery - 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. toxor88/yii2-widget-switchery

ActiveYii2-extension

toxor88/yii2-widget-switchery
=============================

Enhanced Yii2 wrapper for the Switchery.js plugin.

1.0(11y ago)472.0k↓43.6%2BSD 3-ClausePHPPHP &gt;=5.4.0

Since May 19Pushed 9y ago3 watchersCompare

[ Source](https://github.com/toxor88/yii2-widget-switchery)[ Packagist](https://packagist.org/packages/toxor88/yii2-widget-switchery)[ Docs](https://github.com/toxor88/yii2-widget-switchery)[ RSS](/packages/toxor88-yii2-widget-switchery/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

yii2-widget-switchery
=====================

[](#yii2-widget-switchery)

[![Latest Stable Version](https://camo.githubusercontent.com/abb2ce70db6540d3879cae086c7c9f902d22603da4064fb9032b6f3a4ab66113/68747470733a2f2f706f7365722e707567782e6f72672f746f786f7238382f796969322d7769646765742d7377697463686572792f762f737461626c65)](https://packagist.org/packages/toxor88/yii2-widget-switchery)[![License](https://camo.githubusercontent.com/a6c84cfd2383494fdf7a2d64cd5780a7fa638b714a81bceb0cb9a7f3107b3e41/68747470733a2f2f706f7365722e707567782e6f72672f746f786f7238382f796969322d7769646765742d7377697463686572792f6c6963656e7365)](https://packagist.org/packages/toxor88/yii2-widget-switchery)[![Total Downloads](https://camo.githubusercontent.com/d60d3e246bd6edf65c6dee0c501c22d4840b39d483cbb9992735b3b31133ea01/68747470733a2f2f706f7365722e707567782e6f72672f746f786f7238382f796969322d7769646765742d7377697463686572792f646f776e6c6f616473)](https://packagist.org/packages/toxor88/yii2-widget-switchery)[![Monthly Downloads](https://camo.githubusercontent.com/6bb027c546115c8b4da5c014343c774269434148a3abcc8771f3c409f36ce864/68747470733a2f2f706f7365722e707567782e6f72672f746f786f7238382f796969322d7769646765742d7377697463686572792f642f6d6f6e74686c79)](https://packagist.org/packages/toxor88/yii2-widget-switchery)[![Daily Downloads](https://camo.githubusercontent.com/c005deb6c39e1a6940baf57da64e657fe3560c7a932465383ef59c102e475672/68747470733a2f2f706f7365722e707567782e6f72672f746f786f7238382f796969322d7769646765742d7377697463686572792f642f6461696c79)](https://packagist.org/packages/toxor88/yii2-widget-switchery)

iOS Switchery Slider ()

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/toxor88/yii2-widget-switchery/blob/master/composer.json) for this extension's requirements and dependencies.

To install, either run

```
$ php composer.phar require toxor88/yii2-widget-switchery "*"

```

or add

```
"toxor88/yii2-widget-switchery": "*"

```

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

Demo
----

[](#demo)

You can refer detailed [documentation and demos](http://abpetkov.github.io/switchery/) on usage of the extension.

Usage
-----

[](#usage)

```
use toxor88\switchery\Switchery;
use yii\web\JsExpression;

// usage without model
echo 'Can do something?';
echo Switchery::widget([
	'name' => 'can_do_something',
	'clientOptions' => [
		'color'              => '#64bd63',
		'secondaryColor'     => '#dfdfdf',
        'jackColor'          => '#fff',
        'jackSecondaryColor' => null,
        'className'          => 'switchery',
        'disabled'           => false,
        'disabledOpacity'    => 0.5,
        'speed'              => '0.1s',
        'size'               => 'default',
	],
    'clientChangeEvent' => new JsExpression('function() {
        alert("checked: " + this.checked);
    }'),
]);

// usage with model
$form->model($model, 'attribute')->widget(Switchery::className(), [ /* widget options... */ ]);

// if you use the defualt ActiveField template, there can be multiple labels. To avoid it use:
// the label displays after the slider:
$form->model($model, 'attribute')->widget(Switchery::className(), [ /* widget options... */ ])->label(false);

// the label displays before the slider:
$form->model($model, 'attribute')->widget(Switchery::className(), [ 'options' => 'label' => null ])->label('label text or inherited from model');
```

License
-------

[](#license)

**yii2-widget-switchery** is released under the BSD 3-Clause License. See the bundled `LICENSE` for details.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4017d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65c5d370023ef80058eeb9aab80f86fc426942d6365695749970ee88d832487f?d=identicon)[toxor88](/maintainers/toxor88)

---

Top Contributors

[![toxor88](https://avatars.githubusercontent.com/u/5667362?v=4)](https://github.com/toxor88 "toxor88 (6 commits)")

---

Tags

pluginjqueryyii2extensionwidgetformcheckboxswitchery

### Embed Badge

![Health badge](/badges/toxor88-yii2-widget-switchery/health.svg)

```
[![Health](https://phpackages.com/badges/toxor88-yii2-widget-switchery/health.svg)](https://phpackages.com/packages/toxor88-yii2-widget-switchery)
```

###  Alternatives

[kartik-v/yii2-widget-select2

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

3279.7M191](/packages/kartik-v-yii2-widget-select2)[kartik-v/yii2-widget-fileinput

An enhanced FileInput widget for Bootstrap 3.x, 4.x &amp; 5.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)

2286.8M95](/packages/kartik-v-yii2-widget-fileinput)[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)[kartik-v/yii2-widget-rating

A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)

444.1M8](/packages/kartik-v-yii2-widget-rating)[kartik-v/yii2-widget-timepicker

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

404.9M14](/packages/kartik-v-yii2-widget-timepicker)

PHPackages © 2026

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