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.


                <script src=""></script>
<div id="container"></div>


                body {
  margin: 10;
  padding: 10;
  overflow: hidden;
  background-color: #f0f0f0;



                // Set up a stage
let stage = new Konva.Stage({
  container: "container",
  width: window.innerWidth,
  height: window.innerHeight
  // add a layer to draw on
  layer = new Konva.Layer(),
  // set some initial dimensions
  x = 20, 
  y = 80,
  // Make a group into which we will add the rect & text     
  group1 = new Konva.Group({draggable: true}), 

  // Make a simple rectangle node      
  rect1 = new Konva.Rect({
    name: "r1",
    x: x,
    y: y,
    width: 120,
    height: 80,
    fill: "magenta",
    name: "rect"

  // Make a text node  
  txt1 = new Konva.Text({
    x: x,
    y: y,
    text: "Stretchy Text",
    fontSize: 20,
    fontFamily: "Calibri",
    fill: "green",
    name: "text"
  // set up the transformer
  tr1 = new Konva.Transformer();

// Now compose the shapes onto the canvas and connect them as needed

// Add the layer to the stage and shapes to layer
layer.add(group1, tr1);

// add shapes into the group - you can do these individually too
group1.add(rect1, txt1);

// Finally connect the transformer to the group

// Set the group x-scale to mimic a horizontal stretch by the user