PHPackages                             soderlind/class-customizer-toggle-control - 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. soderlind/class-customizer-toggle-control

ActiveWordpress-dropin[Utility &amp; Helpers](/categories/utility)

soderlind/class-customizer-toggle-control
=========================================

WordPress Customizer Toggle Control is a generic toggle control you can use to replace the checkbox control.

3545914[1 issues](https://github.com/soderlind/class-customizer-toggle-control/issues)CSS

Since Aug 20Pushed 6y ago7 watchersCompare

[ Source](https://github.com/soderlind/class-customizer-toggle-control)[ Packagist](https://packagist.org/packages/soderlind/class-customizer-toggle-control)[ RSS](/packages/soderlind-class-customizer-toggle-control/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

WordPress Customizer Toggle Control
===================================

[](#wordpress-customizer-toggle-control)

A generic toggle control you can use to replace the checkbox control.

[![](assets/customizer-toggle-control.gif)](assets/customizer-toggle-control.gif)

Demo
----

[](#demo)

I've added this control to my [customizer demo theme](https://github.com/soderlind/2016-customizer-demo).

Installing the control
----------------------

[](#installing-the-control)

Add the following to your composer.json file and run `composer update`

```
"require": {
	"soderlind/class-customizer-toggle-control": "dev-master"
},
"extra": {
	"installer-paths": {
		"inc/{$name}": [
			"soderlind/class-customizer-toggle-control"
		]
	}
}
```

If you want to install into the `vendor` folder, use

```
"require": {
	"soderlind/class-customizer-toggle-control": "dev-master"
},
"extra": {
	"installer-paths": {
		"vendor/soderlind/{$name}": [
			"soderlind/class-customizer-toggle-control"
		]
	}
}
```

or, clone the repo into `inc`

Include the class
-----------------

[](#include-the-class)

```
/**
 * Check for WP_Customizer_Control existence before adding custom control because WP_Customize_Control
 * is loaded on customizer page only
 *
 * @see _wp_customize_include()
 */
if ( class_exists( 'WP_Customize_Control' ) ) {
	require_once  dirname( __FILE__ ) . '/inc/class-customizer-toggle-control/class-customizer-toggle-control.php';
}
```

Adding the control
------------------

[](#adding-the-control)

```
$wp_customize->add_control( new Customizer_Toggle_Control( $wp_customize, 'my_control', array(
		'label'	      => esc_html__( 'Toggle me on or off', 'my-lang' ),
		'section'     => 'my_section',
		'settings'    => 'my_setting',
		'type'        => 'ios',// light, ios, flat
) ) );
```

Three different types are available

[![](assets/types.png)](assets/types.png)

Toggling the control title
--------------------------

[](#toggling-the-control-title)

You must update the [js/customizer-toggle-control.js](js/customizer-toggle-control.js#L10-L15) file if you want to change the title color when a toggle is disabled/enabled.

Credits
-------

[](#credits)

The [CSS](pure-css-toggle-buttons) is copyright (c) 2016 by Mauricio Allende

You can see his [demo at CodePen.io](http://codepen.io/mallendeo/pen/eLIiG)

The CSS is [licensed](https://blog.codepen.io/legal/licensing/) under the terms of the [MIT license](http://opensource.org/licenses/MIT)

Copyright and License
---------------------

[](#copyright-and-license)

WordPress Customizer Toggle Control is copyright 2016 Per Soderlind

WordPress Customizer Toggle Control is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

WordPress Customizer Toggle Control is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Extension. If not, see .

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 91.3% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1649452?v=4)[Per Søderlind](/maintainers/soderlind)[@soderlind](https://github.com/soderlind)

---

Top Contributors

[![soderlind](https://avatars.githubusercontent.com/u/1649452?v=4)](https://github.com/soderlind "soderlind (21 commits)")[![Kavboy](https://avatars.githubusercontent.com/u/24781933?v=4)](https://github.com/Kavboy "Kavboy (1 commits)")[![mahdiyazdani](https://avatars.githubusercontent.com/u/8451635?v=4)](https://github.com/mahdiyazdani "mahdiyazdani (1 commits)")

---

Tags

wordpress-customizer-control

### Embed Badge

![Health badge](/badges/soderlind-class-customizer-toggle-control/health.svg)

```
[![Health](https://phpackages.com/badges/soderlind-class-customizer-toggle-control/health.svg)](https://phpackages.com/packages/soderlind-class-customizer-toggle-control)
```

###  Alternatives

[santigarcor/laravel-vuetable

Vuetable laravel backend package

2750.3k](/packages/santigarcor-laravel-vuetable)[bitbag/product-bundle-plugin

Product bundle for Sylius.

2174.4k](/packages/bitbag-product-bundle-plugin)

PHPackages © 2026

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