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


                <ul id="tabs" class="tabs ui-helper-clearfix">
  <li><a href="#tab1">Model</a></li>
  <li><a href="#tab2">View</a></li>
  <li><a href="#tab3">Controller</a></li>

<div id="tab1" class="tab hidden">
    Model Content

<div id="tab2" class="tab hidden">
    View Content

<div id="tab3" class="tab hidden">
    Controller Content


                @import url(,400,700);

* {
	font-family: 'Lato', sans-serif;
    font-size: 12px;
    text-shadow: 0 -1px 0 #ffffff;
.tabs {
    padding: 0px; 
    margin: 10px 0px 0px 0px;
    position: relative;
    z-index: 1;
    top: 1px;
.tabs li {
    float: left;
    padding: 7px 10px;
    background-color: #F6F6F6;
    list-style: none;
    margin-left: 5px;
    border: 1px solid #ccc;
    -webkit-border-top-left-radius: 3px;
    -webkit-border-top-right-radius: 3px;
    -moz-border-radius-topleft: 3px;
    -moz-border-radius-topright: 3px;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
.tabs li a {
    color: #999;
    font-weight: bold;
    text-decoration: none;
.tabs {
    background-color: #fff;
    border-bottom: 1px solid #fff;
.tabs a {
    color: #000;
    cursor: default;
.tab {
    border: solid 1px #ccc;
    padding: 10px;   

.hidden {
	display: none;

/* clearfix from jQueryUI */
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.ui-helper-clearfix { display: inline-block; }
/* required comment for clearfix to work in Opera \*/
* html .ui-helper-clearfix { height:1%; }
.ui-helper-clearfix { display:block; }


                import { Component } from "//"

var Tabs = can.Control.extend({
	// initialize widget
	init: function(el) {

	changeActiveTab(newLi) {
		if (this.activeLi == newLi) { return }
		// Hide the existing tab contents.
		if (this.activeLi) {

		// Show the new tab contents.
		this.activeLi = newLi
	getContentForLi(li) {
		let id = li.querySelector('a').getAttribute('href')
		id = id.replace('#', '')
		let el = document.getElementById(id)
		return el
	'li click'(el, e) {
// adds the controller to the element
new Tabs('#tabs')