PHPackages                             bogdik/yii2-widget-switchinput - 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. bogdik/yii2-widget-switchinput

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

bogdik/yii2-widget-switchinput
==============================

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes &amp; radios as toggle switchinputes (sub repo split from yii2-widgets)

1.3.3(8y ago)051BSD 3-ClausePHP

Since Nov 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/bogdik/yii2-widget-switchinput)[ Packagist](https://packagist.org/packages/bogdik/yii2-widget-switchinput)[ Docs](https://github.com/bogdik/yii2-widget-switchinput)[ RSS](/packages/bogdik-yii2-widget-switchinput/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (1)Versions (11)Used By (0)

yii2-widget-switchinput
=======================

[](#yii2-widget-switchinput)

[![Latest Stable Version](https://camo.githubusercontent.com/684109027e03003311d00446d3810e2dd14982a4fb57f8f3ee3271a9832b006c/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d737769746368696e7075742f762f737461626c65)](https://packagist.org/packages/bogdik/yii2-widget-switchinput)[![License](https://camo.githubusercontent.com/e287740e2444aef4ae39b406558c5b28154231593af4fc97f996501622bb38e7/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d737769746368696e7075742f6c6963656e7365)](https://packagist.org/packages/bogdik/yii2-widget-switchinput)[![Total Downloads](https://camo.githubusercontent.com/3ee7bef5c1b8f53e4f70efe3332592b70fff505ef18460a951a500fc0854455c/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d737769746368696e7075742f646f776e6c6f616473)](https://packagist.org/packages/bogdik/yii2-widget-switchinput)[![Monthly Downloads](https://camo.githubusercontent.com/21fcba1a6985d4dcf6a45942167f530ae584ccd42050b94d25ca66d231b6fccd/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d737769746368696e7075742f642f6d6f6e74686c79)](https://packagist.org/packages/bogdik/yii2-widget-switchinput)[![Daily Downloads](https://camo.githubusercontent.com/e67e49c85f032a5d5e271d1c92ab14898285b45ca08c4e9c4e93ff392b802fc8/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d737769746368696e7075742f642f6461696c79)](https://packagist.org/packages/bogdik/yii2-widget-switchinput)

The SwitchInput widget turns checkboxes and radio buttons into toggle switchinputes. The plugin is a wrapper for the [Bootstrap Switch Plugin](http://www.bootstrap-switch.org) and is specially styled for Bootstrap 3.

> NOTE: This extension is a sub repo split of [yii2-widgets](https://github.com/kartik-v/yii2-widgets). The split has been done since 08-Nov-2014 to allow developers to install this specific widget in isolation if needed. One can also use the extension the previous way with the whole suite of [yii2-widgets](http://demos.krajee.com/widgets).

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/kartik-v/yii2-widget-switchinput/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.

To install, either run

```
$ php composer.phar require bogdik/yii2-widget-switchinput "*"

```

or add

```
"bogdik/yii2-widget-switchinput": "*"

```

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

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

[](#latest-release)

> NOTE: The latest version of the module is v1.3.0 released on 14-Jan-2015. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-switchinput/blob/master/CHANGE.md) for details.

Demo
----

[](#demo)

You can refer detailed [documentation and demos](http://demos.krajee.com/widget-details/switchinput) on usage of the extension.

Usage
-----

[](#usage)

```
use bogdik\switchinput\SwitchInput;

// Usage with ActiveForm and model
echo $form->field($model, 'status')->widget(SwitchInput::classname(), [
    'type' => SwitchInput::CHECKBOX
]);

// With model & without ActiveForm
echo SwitchInput::widget([
    'name' => 'status_1',
    'type' => SwitchInput::RADIO
]);
```

If you use RenderAjax just use static widths. Example:

```
echo $form->field($model, 'status')->widget(SwitchInput::classname(), [
    'type' => SwitchInput::CHECKBOX,
    'handleWidth'=>'53',
    'labelWidth'=>'77',
    'staticWidth'=>'53',
]);
```

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% 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 ~103 days

Recently: every ~224 days

Total

10

Last Release

3278d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f88765a8180749026de8944f0721ee0b11085143618729908eb3f54ad3b15a9?d=identicon)[bogdik](/maintainers/bogdik)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (26 commits)")[![fedemotta](https://avatars.githubusercontent.com/u/250785?v=4)](https://github.com/fedemotta "fedemotta (1 commits)")[![jones6951](https://avatars.githubusercontent.com/u/1696008?v=4)](https://github.com/jones6951 "jones6951 (1 commits)")

---

Tags

pluginjqueryyii2extensionwidgetbootstrapforminputtoggleswitchinput

### Embed Badge

![Health badge](/badges/bogdik-yii2-widget-switchinput/health.svg)

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

###  Alternatives

[kartik-v/yii2-widget-switchinput

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes &amp; radios as toggle switchinputes (sub repo split from yii2-widgets)

384.4M13](/packages/kartik-v-yii2-widget-switchinput)[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-touchspin

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes &amp; radios as toggle touchspines (sub repo split from yii2-widgets)

184.1M6](/packages/kartik-v-yii2-widget-touchspin)[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)[kartik-v/yii2-widget-colorinput

An enhanced Yii 2 widget encapsulating the HTML 5 color input (sub repo split from yii2-widgets)

324.8M10](/packages/kartik-v-yii2-widget-colorinput)[kartik-v/yii2-widget-rangeinput

An enhanced Yii 2 widget encapsulating the HTML 5 range input (sub repo split from yii2-widgets)

193.9M3](/packages/kartik-v-yii2-widget-rangeinput)

PHPackages © 2026

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