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 src="https://derbyjs.github.io/derby-standalone/dist/0.6.0-alpha40/derby-standalone.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Open+Sans:400,700' rel='stylesheet' type='text/css'>

<!-- we create a template to use as the body -->
<script type="text/template" id="body">
  <tabs selectedIndex="{{0}}">
    <pane title="One"><b>Hi</b></pane>
    <pane title="Two">ho</pane>
    <pane title="Three">away</pane>
    <pane title="Four">we <span class="highlight">{{_page.punchline}}!</span></pane>

<!-- define a component to use in our body -->
<script type="text/template" id="tabs" data-element="tabs" data-arrays="pane">
  {{each @pane as #pane, #i}}
    <div class="tabs-pane {{if #i === selectedIndex}}active{{/}}">    {{#pane.content}}
  <ul class="tabs">
    {{each @pane as #pane, #i}}
      here we use some template logic to decide a class.
      we also define clicking behavior by calling the select function defined in the code.
      <li class="{{if #i === selectedIndex}}active{{/}}" on-click="select(#i)">

body {
  font-family: "Source Sans Pro";
.tabs {
  list-style: none;
  padding: 0;
.tabs > li {
  display: inline-block;
  padding: 10px;
  background: #192F41;
  color: #C8EBF3 ;
  cursor: default;
.tabs > li.active {
  background: #157EBF;
  color: white;
.tabs-pane {
  display: none;
  font-size: 30px;
  padding: 20px 0;
.tabs-pane.active {
  display: block;
.highlight {
  color: #F2627C;

              // https://github.com/derbyjs/derby-standalone
var app = derby.createApp();
// convenience function for loading templates that are defined as <script type="text/template">

// we register our "tabs" component by associating the Tabs class with the 'tabs' template
app.component('tabs', Tabs);
function Tabs() {}
Tabs.prototype.init = function(model) {
  // init is called at the time of instanciation
  model.setNull('selectedIndex', 0);
Tabs.prototype.create = function() {
  // called when the DOM is ready
Tabs.prototype.select = function(i) {
  // we've defined a view function, i.e. a function that can be called from the view
  this.model.set('selectedIndex', i);

var page = app.createPage();

//this attaches your rendered templates to the body. You could instead append the templates into the div of your choice

page.model.set('_page.punchline', 'go');

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