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.


                <script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>

<body ng-app="app">
  <main ng-controller="MainController as vm" layout="column">
    <div class="add-button" layout="row" layout-padding>
      <md-button class="md-raised md-primary" ng-click="vm.addCard()">Add Card</md-button>
    <md-content class="content" layout="row" layout-align="start start" layout-padding layout-wrap flex>
      <card ng-repeat="card in" count="{{card}}" card-id="{{}}" on-close="vm.removeCard($index)"></card>
  <script type="text/ng-template" id="card.html">
    <md-card class="card-inner">
          <span class="md-headline">Card {{card.cardId}}</span>
          <span class="md-subhead">Some other text</span>
      <md-card-actions layout="row" layout-align="end center">        
        <md-button ng-click="card.close()">Close</md-button>


                html, body {
  height: 100%;

main {
  height: 100%; 

.add-button {
  position: absolute;
  z-index: 10;

.content {
  padding-top: 64px;

card {
  width: 400px;

.card-media {
  background-color: #999999;



class MainController {
  count = 1;  
  cards = [{ id: 0 }];

  addCard() {{ id: this.count++ });

  removeCard(card) {, 1);

class CardController {
  inner = this.$element[0].querySelector(".card-inner");

  constructor(private $scope, private $element) {
    TweenLite.from($element, 0.5, { y: 50, alpha: 0 });

  close() {
    var onComplete = () => {
    var tl = new TimelineLite({ onComplete })
      .to(this.inner, 0.5, { scale: 0.5, autoAlpha: 0 }, 0)
      .to(this.$element, 0.25, { width: 0, height: 0, padding: 0, autoAlpha: 0 });   

var cardComponent = {
  controller: CardController,
  controllerAs: "card",
  templateUrl: "card.html",
  bindings: {
    cardId:  "@",
    onClose: "&"

  .module("app", ["ngMaterial"])
  .controller("MainController", MainController)
  .component("card", cardComponent);