cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation


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.

              <script type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="//golden-layout.com/files/latest/js/goldenlayout.min.js"></script>
<link type="text/css" rel="stylesheet" href="//golden-layout.com/files/latest/css/goldenlayout-base.css" />
<link type="text/css" rel="stylesheet" href="//golden-layout.com/files/latest/css/goldenlayout-dark-theme.css" />
  font: 14px Arial, sans-serif;
  padding: 10px;
  text-align: center;

  font-weight: bold;
  background: #EBDFDF;
  color: #DE1010;
  border: 1px solid #DE1010;
  margin: 5px;
  margin: 10px auto;
  width: 100px;
  display: block;
  padding: 5px;
  background: #2a2a2a;
  border: 1px solid #1a1a1a;
  color: #EEE;
  box-shadow: inset -1px -1px 4px 1px rgba( 0, 0, 0, 0.1 );

              var config = {
  content: [{
    type: 'row',
      type: 'component',
      componentName: 'testComponent',
      componentState: { label: 'A' }
      type: 'column',
        type: 'component',
        componentName: 'testComponent',
        componentState: { label: 'B' }
        type: 'component',
        componentName: 'testComponent',
        componentState: { label: 'C' }

var myLayout,
    savedState = localStorage.getItem( 'savedState' );

if( savedState !== null ) {
  	myLayout = new GoldenLayout( JSON.parse( savedState ) );
} else {
  	myLayout = new GoldenLayout( config );

myLayout.on( 'stateChanged', function(){
  	var state = JSON.stringify( myLayout.toConfig() );
  	localStorage.setItem( 'savedState', state );

var persistentComponent = function( container, state ){

  //Check for localStorage
  if( !typeof window.localStorage ) {
    container.getElement().append(  '<h2 class="err">Your browser doesn\'t support localStorage.</h2>');
  // Create the input
  var input = $( '<input type="text" />' );

  // Set the initial / saved state
  if( state.label ) {
    input.val( state.label );

  // Store state updates
  input.on( 'change', function(){
      label: input.val()

  // Append it to the DOM
  container.getElement().append(  '<h2>I\'ll be saved to localStorage</h2>', input );

myLayout.registerComponent( 'testComponent', persistentComponent );

Loading ..................