Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


    <div class="wrap">
      <div class="half">
        <div class="colorPicker"></div>
      <div class="half readout">
          iro.js is an HSV color picker widget for JavaScript with a modern SVG-based user interface -- and no jQuery or extra CSS / images.
        <span class="title link">Head to <a href="" target="blank"></a> for full documentation and features, or check out the source code on <a href="" target="blank">GitHub</a>!
        <span class="title">Selected Color:</span>
        <div id="values"></div>
        <input id="hexInput"></input>


                body {
  color: #fff;
  background: #171F30;
  line-height: 150%;

.wrapper svg {

.wrap {
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  .half {
    width: 50%;
    padding: 32px 0;

.title {
  font-family: sans-serif;
  line-height: 24px;
  display: block;
  padding: 8px 0;

.readout {
  margin-top: 32px;
  line-height: 180%;

#values {
 font-family: monospace;
  line-height: 150%;

.link {
  margin-top: 16px;
  a {
    color: MediumSlateBlue;


                // Create a new color picker instance
var colorPicker = new iro.ColorPicker(".colorPicker", {
  // color picker options
  // Option guide:
  width: 280,
  color: "rgb(255, 0, 0)",
  borderWidth: 1,
  borderColor: "#fff",

var values = document.getElementById("values");
var hexInput = document.getElementById("hexInput");

colorPicker.on(["color:init", "color:change"], function(color){
  // Show the current color in different formats
  // Using the selected color:
  values.innerHTML = [
    "hex: " + color.hexString,
    "rgb: " + color.rgbString,
    "hsl: " + color.hslString,
  hexInput.value = color.hexString;

hexInput.addEventListener('change', function() {
  colorPicker.color.hexString = this.value;