PHPackages                             lotltd/yii2-widget-colorinput - 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. lotltd/yii2-widget-colorinput

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

lotltd/yii2-widget-colorinput
=============================

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

1.0.6(5y ago)0381BSD-3-ClauseJavaScript

Since Nov 8Pushed 5y agoCompare

[ Source](https://github.com/lotltd/yii2-widget-colorinput)[ Packagist](https://packagist.org/packages/lotltd/yii2-widget-colorinput)[ Docs](https://github.com/kartik-v/yii2-widget-colorinput)[ RSS](/packages/lotltd-yii2-widget-colorinput/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (8)Used By (1)

 [ ![Krajee Logo](https://camo.githubusercontent.com/4addfbb3869c3fc7d79befea4f06d9cf3655a686fb503df0da1d725859cfdef9/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f6b72616a65652d6c6f676f2d622e706e67) ](http://demos.krajee.com "Krajee Demos")
 yii2-widget-colorinput ---

 [ ![Donate](https://camo.githubusercontent.com/4af77d425ca202e55ab3d711b438e238ded194735bc345a019ac060e03e26227/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67) ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal")
==========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------yii2-widget-colorinput--------------------)

[![Stable Version](https://camo.githubusercontent.com/139d1e8c043421d08b3ea1fa9731a64a0af28f923233768631a20aadf85c5c7f/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d636f6c6f72696e7075742f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-widget-colorinput)[![Unstable Version](https://camo.githubusercontent.com/df98733fb5fa2025bec8bd689a0a55ae4cb09b9f32f4686c87a838af4951e3d3/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d636f6c6f72696e7075742f762f756e737461626c65)](https://packagist.org/packages/kartik-v/yii2-widget-colorinput)[![License](https://camo.githubusercontent.com/3e86f93ed02ac22fb891a07a11a3dbc15c58c0cade903d226195881182d863ca/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d636f6c6f72696e7075742f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-widget-colorinput)[![Total Downloads](https://camo.githubusercontent.com/93f6b3fcdebf5291b150fe80a5299f934016122871cf587181dca4eed5b1b188/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d636f6c6f72696e7075742f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-widget-colorinput)[![Monthly Downloads](https://camo.githubusercontent.com/02267250980d52f48cc70d3a1eb15b21cb06876220f61e78762173d521363c11/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d636f6c6f72696e7075742f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-widget-colorinput)[![Daily Downloads](https://camo.githubusercontent.com/eb77c31a28a19b4ea35c7ef5c4a4a1df114faf39ee4b3d218e219912a1d9cf21/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d636f6c6f72696e7075742f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-widget-colorinput)

The ColorInput widget is an advanced ColorPicker input styled for Bootstrap. It uses a combination of the HTML5 color input and/or the [JQuery Spectrum Plugin](http://bgrins.github.io/spectrum) for rendering the color picker. You can use the Native HTML5 color input by setting the `useNative` option to `true`. Else, the Spectrum plugin polyfills for unsupported browser versions.

- Specially styled for Bootstrap 3.x and 4.x with customizable caption showing the output of the control.
- Ability to prepend and append addons.
- Allow the input to be changed both via the control or the text box.
- The Spectrum plugin automatically polyfills the `HTML5 color input` for unsupported browser versions.

> 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-colorinput/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 kartik-v/yii2-widget-colorinput "*"

```

or add

```
"kartik-v/yii2-widget-colorinput": "*"

```

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

Release Updates
---------------

[](#release-updates)

> NOTE: Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-colorinput/blob/master/CHANGE.md) for details on release wise changes.

Demo
----

[](#demo)

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

Usage
-----

[](#usage)

```
use kartik\color\ColorInput;

// Usage with ActiveForm and model
echo $form->field($model, 'color')->widget(ColorInput::classname(), [
    'options' => ['placeholder' => 'Select color ...'],
]);

// With model & without ActiveForm
echo 'Select Color';
echo ColorInput::widget([
    'model' => $model,
    'attribute' => 'saturation',
]);
```

License
-------

[](#license)

**yii2-widget-colorinput** 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

Popularity7

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 74.5% 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 ~354 days

Recently: every ~427 days

Total

7

Last Release

2079d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/675cf2ed4e79b939b8deae503cab42c643627bbce7a2ad9a768afb401b4ef03b?d=identicon)[apostolp](/maintainers/apostolp)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (35 commits)")[![dogrocker](https://avatars.githubusercontent.com/u/8379027?v=4)](https://github.com/dogrocker "dogrocker (2 commits)")[![apostolp](https://avatars.githubusercontent.com/u/807654?v=4)](https://github.com/apostolp "apostolp (2 commits)")[![memboc](https://avatars.githubusercontent.com/u/7403119?v=4)](https://github.com/memboc "memboc (2 commits)")[![noffily](https://avatars.githubusercontent.com/u/10633300?v=4)](https://github.com/noffily "noffily (2 commits)")[![Shaposhnikov](https://avatars.githubusercontent.com/u/2725815?v=4)](https://github.com/Shaposhnikov "Shaposhnikov (1 commits)")[![thiagotalma](https://avatars.githubusercontent.com/u/612578?v=4)](https://github.com/thiagotalma "thiagotalma (1 commits)")[![iamguba](https://avatars.githubusercontent.com/u/14358417?v=4)](https://github.com/iamguba "iamguba (1 commits)")[![hamrak](https://avatars.githubusercontent.com/u/5807028?v=4)](https://github.com/hamrak "hamrak (1 commits)")

---

Tags

pluginHTML5colorjqueryyii2extensionwidgetforminput

### Embed Badge

![Health badge](/badges/lotltd-yii2-widget-colorinput/health.svg)

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

###  Alternatives

[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)[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-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-datepicker

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

1097.0M60](/packages/kartik-v-yii2-widget-datepicker)[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)

PHPackages © 2026

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