Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's 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 it's URL and the proper URL extention.

+ 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.


Save Automatically?

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.


    <link href="" rel="stylesheet">
    <div id='grid'>
      <div class="toolbar header start">cool editor</div>
      <div class="panel middle start scroll">
        This left side panel hasreallywidetextthattakesupalotofspace
        and a min width of 150px. 
        Closing this panel will set display to <i>none</i>;
      <div class="toolbar footer start">
        <button class="fa fa-plus-circle"></button>
        <button class="fa fa-minus-circle"></button>

      <div class="toolbar header center">
        <button class="fa fa-save"></button>
        <span class='spacer'></span>
        <label>current file</label>
        <span class='spacer'></span>
        <button class="fa fa-file"></button>
      <div class="content middle center">
        this is the content that we are editing       
      <div class="toolbar footer center">
        <button id="toggle-left"> &lt;</button>
        <span class='spacer'></span>
        <button id="toggle-right"> &gt;</button>

      <div class="toolbar header end">selected item</div>

      <div class="panel middle end scroll">
        the right side panel
      <div class="toolbar footer end">more actions</div>


                /* the grid */

#grid {
    display: grid;
    box-sizing: border-box;
    width: 100vw;
    height: 100vh;
        [start] minmax(auto, min-content) 
        [center] auto 
        [end] minmax(auto, min-content);
        [header] 2em 
        [middle] auto 
        [footer] 2em;
    padding: 0;
    grid-column-gap: 1px;
    grid-row-gap: 1px;
    background-color: #333;

.start { grid-column-start: start; }
.center { grid-column-start: center; }
.end { grid-column-start: end; }
.header { grid-row-start: header; }
.middle { grid-row-start: middle; }
.footer { grid-row-start: footer; }

/* extra styles */
.scroll { overflow: auto;  }
.spacer { flex: 1; }

.panel, .toolbar { background-color: #ccc; }

.toolbar {
  flex-direction: row;
  align-items: stretch;
.toolbar button {
  background-color: #ccc;
  border: 0px solid black;
.toolbar button:hover {
  background-color: #888;
.content { background-color: white; }

html, body {
  font-family: sans-serif;

.start, .end { min-width: 150px; }
.closed { display: none; }



                   const $ = (selector) => document.querySelector(selector)
   const $$ = (selector) => document.querySelectorAll(selector)
   const on = (elem, type, listener) => elem.addEventListener(type,listener)

       $$(".start").forEach((elem) => elem.classList.toggle('closed'))
       $$(".end").forEach((elem) => elem.classList.toggle('closed'))