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

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

2amigos/yii2-switchery-widget
=============================

iOS 7 style switch widget for Yii2.

1.0.2(8y ago)776.4k↓18.1%2[1 issues](https://github.com/2amigos/yii2-switchery-widget/issues)BSD-3-ClausePHP

Since Jun 23Pushed 7y ago4 watchersCompare

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

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

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

[](#yii2-switchery-widget)

[![Latest Version](https://camo.githubusercontent.com/cd69a2732ae189a47076bc170cda7cb26256ba9a2d4953190eadf8dcef548f37/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f32616d69676f732f796969322d7377697463686572792d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://github.com/2amigos/yii2-switchery-widget/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/d7b49b7cf8859c7d5e02a0e966e2ddedbd5263d62879569ea389c3cbe29d2777/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f32616d69676f732f796969322d7377697463686572792d7769646765742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/2amigos/yii2-switchery-widget)[![Coverage Status](https://camo.githubusercontent.com/eeaaa1d1510cf88fdc3b816ce6033456e5378dd70fab754b864028d0add13277/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f32616d69676f732f3a7061636b6167655f6e616d652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/2amigos/yii2-switchery-widget/code-structure)[![Quality Score](https://camo.githubusercontent.com/b104d90bec72094faf12a3811c11e721c21028b66f7b7a2c83145a4cbe6b9e3b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f32616d69676f732f796969322d7377697463686572792d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/2amigos/yii2-switchery-widget)[![Total Downloads](https://camo.githubusercontent.com/4bfe733cbf7801c9c53959f3b654280e09c30d0dc9257e8b158fb598fde45969/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f32616d69676f732f796969322d7377697463686572792d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/2amigos/yii2-switchery-widget)

Yii2 wrapper for [iOS 7 style switches](http://abpetkov.github.io/switchery/) for your checkboxes

Install
-------

[](#install)

Via Composer

```
$ composer require 2amigos/yii2-switchery-widget
```

or add inside compsoer.json

```
"2amigos/yii2-switchery-widget": "*"
```

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

Usage
-----

[](#usage)

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

// usage with model
echo $form->field($model, 'is_required')->widget(Switchery::className(), [
      'options' => [
          'label' => false
      ],
      'clientOptions' => [
          'color' => '#5fbeaa',
      ]
 ]);

// usage without model
echo Switchery::widget([
    'name' => 'is_required',
    'value' => $model->is_required,
    'clientOptions' => [
        'color' => '#5FBEAA',
        'secondaryColor' => '#CCCCCC',
        'jackColor' => '#FFFFFF',
    ],
    'clientEvents' => [
        'change' => new JsExpression('function() {
            console.log("Cool! You changed my state.");
        }')
    ]
]);
```

Testing
-------

[](#testing)

```
$ phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Nikola Radovic](https://github.com/dzona)
- [All Contributors](../../contributors)

License
-------

[](#license)

The BSD License (BSD). Please see [License File](LICENSE.md) for more information.

> [![](https://camo.githubusercontent.com/9fd8f1de41dc23003bb2a54034cb6658dde5be97092e195a62d629d0d7fa7f6c/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f35353336333339346437323934356666376564333132353536656330343165302e706e67)](http://www.2amigos.us)
>  *web development has never been so fun*
>  [www.2amigos.us](http://www.2amigos.us)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

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

Total

3

Last Release

3248d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/566016?v=4)[Antonio Ramirez](/maintainers/tonydspaniard)[@tonydspaniard](https://github.com/tonydspaniard)

---

Top Contributors

[![dzona](https://avatars.githubusercontent.com/u/1159689?v=4)](https://github.com/dzona "dzona (9 commits)")

---

Tags

2amigospluginswitcherywidgetyii2yii2extensionyiiyii 22amigosswitchery

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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