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.



Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO


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.


Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:


Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO


                <html ng-app="ionicApp">
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

    <title>Side Menus</title>

    <link href="//" rel="stylesheet">
    <script src="//"></script>

  <body ng-controller="MainCtrl">


    <script id="templates/event-menu.html" type="text/ng-template">
      <ion-side-menus enable-menu-with-back-views="false">

          <ion-nav-bar class="bar-positive">

            <ion-nav-buttons side="left">
              <button class="button button-icon button-clear ion-navicon" menu-toggle="left">

          <ion-nav-view name="menuContent"></ion-nav-view>

        <ion-side-menu side="left">
            <ul class="list">
              <!-- Note each link has the 'menu-close' attribute so the menu auto closes when clicking on one of these links -->
              <a href="#/event/check-in" class="item" menu-close>Check-in</a>
              <a href="#/event/attendees" class="item" menu-close>Attendees</a>


    <script id="templates/home.html" type="text/ng-template">
      <ion-view view-title="Welcome">
        <ion-content class="padding">
          <p>Swipe to the right to reveal the left menu.</p>
          <p>(On desktop click and drag from left to right)</p>

    <script id="templates/check-in.html" type="text/ng-template">
      <ion-view view-title="Event Check-in">
          <form class="list" ng-show="showForm">
            <div class="item item-divider">
              Attendee Info
            <label class="item item-input">
              <input type="text" placeholder="First Name" ng-model="attendee.firstname">
            <label class="item item-input">
              <input type="text" placeholder="Last Name" ng-model="attendee.lastname">
            <div class="item item-divider">
              Shirt Size
            <ion-radio ng-repeat="shirtSize in shirtSizes"
              {{ shirtSize.text }}
            <div class="item item-divider">
            <ion-toggle ng-model="attendee.vegetarian">
            <div class="padding">
              <button class="button button-block" ng-click="submit()">Checkin</button>

          <div ng-hide="showForm">
            <pre ng-bind="attendee | json"></pre> 
            <a href="#/event/attendees">View attendees</a>

    <script id="templates/attendees.html" type="text/ng-template">
      <ion-view view-title="Event Attendees">
          <div class="list">
            <ion-toggle ng-repeat="attendee in attendees | orderBy:'firstname' | orderBy:'lastname'"
              {{ attendee.firstname }}
              {{ attendee.lastname }}
            <div class="item item-divider">
            <div class="item" ng-repeat="msg in activity">
              {{ msg }}



                body {
  cursor: url(''), auto;

.platform-ios {
    background-color: #174790 !important;
    background: -moz-radial-gradient(center, ellipse cover, #2e599b 0%, #123873 100%);
    background: -webkit-radial-gradient(center, ellipse cover, #2e599b 0%, #123873 100%);
    background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #2e599b), color-stop(100%, #123873));
    background: -o-radial-gradient(center, ellipse cover, #2e599b 0%, #123873 100%);
    background: -ms-radial-gradient(center, ellipse cover, #2e599b 0%, #123873 100%);
    background: radial-gradient(ellipse at center, #2e599b 0%, #123873 100%);

.platform-ios .item {
  background: transparent;
  border: none;
  color: white;



                angular.module('ionicApp', ['ionic'])

.config(function($stateProvider, $urlRouterProvider) {

    .state('eventmenu', {
      url: "/event",
      abstract: true,
      templateUrl: "templates/event-menu.html"
    .state('eventmenu.home', {
      url: "/home",
      views: {
        'menuContent' :{
          templateUrl: "templates/home.html"
    .state('eventmenu.checkin', {
      url: "/check-in",
      views: {
        'menuContent' :{
          templateUrl: "templates/check-in.html",
          controller: "CheckinCtrl"
    .state('eventmenu.attendees', {
      url: "/attendees",
      views: {
        'menuContent' :{
          templateUrl: "templates/attendees.html",
          controller: "AttendeesCtrl"

.controller('MainCtrl', function($scope, $ionicSideMenuDelegate) {
  $scope.attendees = [
    { firstname: 'Nicolas', lastname: 'Cage' },
    { firstname: 'Jean-Claude', lastname: 'Van Damme' },
    { firstname: 'Keanu', lastname: 'Reeves' },
    { firstname: 'Steven', lastname: 'Seagal' }
  $scope.toggleLeft = function() {

.controller('CheckinCtrl', function($scope) {
  $scope.showForm = true;
  $scope.shirtSizes = [
    { text: 'Large', value: 'L' },
    { text: 'Medium', value: 'M' },
    { text: 'Small', value: 'S' }
  $scope.attendee = {};
  $scope.submit = function() {
    if(!$scope.attendee.firstname) {
      alert('Info required');
    $scope.showForm = false;

.controller('AttendeesCtrl', function($scope) {
  $scope.activity = [];
  $scope.arrivedChange = function(attendee) {
    var msg = attendee.firstname + ' ' + attendee.lastname;
    msg += (!attendee.arrived ? ' has arrived, ' : ' just left, '); 
    msg += new Date().getMilliseconds();
    if($scope.activity.length > 3) {
      $scope.activity.splice(0, 1);
If you get tired, be like an AJAX request and REST.