HTML

Bootstrap Color Picker Example Using Mjolnic Colorpicker Plugin

In this post i give you example of how to set simple Bootstrap color picker using mjolnic plugin. We don't use often color picker but maybe we require sometimes. So, if you used bootstrap then you have to choose Bootstrap color picker for select color.

  • 4.5/5.0
  • Last updated 10 September, 2022
  • By Admin

mjolnic Bootstrap colorpicker provide several way to use like we can get color code when select color in hex code and also it provide user friendly layout that way it's pretty good. So, let's run bellow example or you can check demo.

Example:

<html lang="en">
<head>
    <title>Bootstrap Color Picker Example</title>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://mjolnic.com/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css" rel="stylesheet">
    <script src="https://code.jquery.com/jquery-2.2.2.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
    <script src="https://mjolnic.com/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js"></script>
</head>
<body>
<div class="container">
    <h1>Bootstrap Color Picker Example</h1> 
    <div id="cp2" class="input-group colorpicker-component"> 
		<input type="text" value="#00AABB" class="form-control" /> 
		<span class="input-group-addon"><i></i></span>
    </div>
</div>
<script type="text/javascript">
	$('#cp2').colorpicker();
</script>
</body>
</html>

You can get more information about bootstrap colorpicker plugin from here : bootstrap-colorpicker.

I hope it can help you...