Bootstrap Colorpicker is a simple and customizable colorpicker component for jQuery, which is also compatible with Twitter Bootstrap.
NOTE that this documentation refers to the next major version of the project.
Previous documentation can be found here: v2.5.2.
You can get the latest version in many different ways:
- Downloading a ZIP file from the releases
- Cloning using Git:
git clone https://github.com/farbelous/bootstrap-colorpicker.git
- Installing via NPM:
npm install bootstrap-colorpicker
- Installing via Yarn:
yarn add bootstrap-colorpicker
- Installing via Composer:
composer require itsjavi/bootstrap-colorpicker
To start using the component, most of the time you will only need the files under the dist
folder.
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="dist/css/bootstrap-colorpicker.css" rel="stylesheet">
</head>
<body>
<div class="container">
<input id="mycp" type="text" class="form-control" />
</div>
<script src="//code.jquery.com/jquery-3.2.1.js"></script>
<script src="dist/js/bootstrap-colorpicker.js"></script>
<script>
$(function () {
$('#mycp').colorpicker();
});
</script>
</body>
Note that this library depends on jQuery >= 2.1.0
.
The Twitter Bootstrap
dependency is totally optional, since this library does not depend directly
on it in order to work, except when Bootstrap-related classes like form-control
and input-group-addon
are used
like in the examples. In that case you will need at least the Bootstrap CSS for everything to be displayed correctly.
The documentation of this project is powered by JSDoc and the Minami template together with Handlebars for the examples.
Older versions:
Please see CONTRIBUTING for details.
Originally written by Stefan Petre.
Continued and maintained by Javi Aguilar and other project contributors.
The MIT License (MIT). Please see License File for more information.