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.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import or require. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.


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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              	<!-- General -->
	<script src="//"></script>

  <!-- Data Provider-->
  <script type="text/javascript" src="//"></script>

	<!-- GoldenLayout -->
	<script type="text/javascript" src="//"></script>
	<link type="text/css" rel="stylesheet" href="//" />
	<link type="text/css" rel="stylesheet" href="//" />

	<!-- SlickGrid -->
	<link rel="stylesheet" type="text/css" href="//" />
	<link rel="stylesheet" type="text/css" href="//" />

	<link rel="stylesheet" type="text/css" href="//" />
	<script type="text/javascript" src="//"></script>

	<script type="text/javascript" src="//"></script>
	<script type="text/javascript" src="//"></script>
	<script type="text/javascript" src="//"></script>

              .ui-widget *{
	vertical-align: middle;
	font: 8pt Arial, sans-serif;

	line-height: 20px;
              var myLayout = new GoldenLayout({
    type: 'row',
      type: 'component',
        title:'FTSE 100 (1-50)',
      componentName: 'stockGrid',
      componentState: { 
        symbols: [
      type: 'component',
      componentName: 'stockGrid',
        title:'FTSE 100 (51-100)',
      componentState: {

var StockGridComponent = function( container, state ) {
  this._container = container;
  this._state = state;
  this._grid = null;
  this._stockDataProvider = new StockDataProvider();
  this._columns = [
    {id: "symbol", name: "Symbol", field: "symbol"},
    {id: "company", name: "Company", field: "company"},
    {id: "price", name: "Price", field: "price"},
    {id: "change", name: "Change", field: "change"},
    {id: "changeRel", name: "Change %", field: "changeRel"},
    {id: "volume", name: "Volume", field: "volume"}
  this._options = {
    editable: false,
    enableAddRow: false,
    enableCellNavigation: true

  container.on( 'open', this._scheduleGridCreation, this );

* This method is used to get around a chrome-bug that manifests itself when using popout windows with Slickgrid
* in Codepens.
* SlickGrid appends a custom style element to the head section and checks for its presence using the document.styleSheets property.
* This seems to cause a number of issues ( 
* The specific problem here is, that when opening a new popout window, GoldenLayout moves all link elements from
* the body to the head section (links are in the body in Codepens). Chrome only updates its document.styleSheets array once
* these stylesheets have been loaded - which is correct.
* What isn't correct is, that Chrome defers adding the styletag - which doesn't need loading - to the document.styleSheets array until
* all dynamically added link elements are loaded.
* To recap: this will happen if all of these conditions are true
* - Have link elements in body instead of head
* - Use SlickGrid - I've never seen anything else access the document.styleSheets array
* - Open Popout window - only then does GoldenLayout move link tags around
* The work-around is to defer SlickGrid's initialisation until all stylesheets have been loaded - which can be checked
* by attaching event listeners  to the link tag's "load event" or - to make sure that we don't miss a stylesheet that has
* already been loaded - poll the link elements sheet property
StockGridComponent.prototype._scheduleGridCreation = function() {
  var interval = setInterval(function(){
    var stylesheetNodes = $('link[rel=stylesheet]'), i;
    for( i = 0; i < stylesheetNodes.length; i++ ) {
      if( stylesheetNodes[ i ].sheet === null ){
    clearInterval( interval );
  }.bind( this ), 10 );

StockGridComponent.prototype._createGrid = function() {
  this._grid = new Slick.Grid( 
    this._stockDataProvider.getStocksBySymbol( this._state.symbols ), 

  this._container.on( 'resize', this._resize, this );
  this._container.on( 'destroy', this._destroy, this );

StockGridComponent.prototype._resize = function() {

StockGridComponent.prototype._destroy = function() {

myLayout.registerComponent( 'stockGrid', StockGridComponent );