Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

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

    <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
    <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
  </head>

  <body>
                
    <ion-nav-view></ion-nav-view>

    <script id="templates/menu.html" type="text/ng-template">
      
      <ion-side-menus enable-menu-with-back-views="false">
        <ion-side-menu-content>
          <ion-nav-bar class="bar-stable">
            <ion-nav-back-button>
            </ion-nav-back-button>
 
            <ion-nav-buttons side="right">
              <button class="button button-icon button-clear ion-navicon" menu-toggle="right">
              </button>
            </ion-nav-buttons>
          </ion-nav-bar>
          <ion-nav-view name="menuContent"></ion-nav-view>
        </ion-side-menu-content>

        <ion-side-menu side="right">
          <ion-header-bar class="bar-stable">
            <h1 class="title">Right</h1>
          </ion-header-bar>
          <ion-content>
            <ion-list>
              <ion-item nav-clear menu-close ui-sref="app.welcome">
                Welcome
              </ion-item>
              <ion-item nav-clear menu-close ui-sref="app.login">
                Login
              </ion-item>
              <ion-item nav-clear menu-close ui-sref="app.tabs1">
                Tabs
              </ion-item>
              <ion-item nav-clear menu-close ui-sref="app.tabs2">
                Tabs 2
              </ion-item>
            </ion-list>
          </ion-content>
        </ion-side-menu>
      </ion-side-menus>
      
    </script>
    
    <script id="templates/tabs1.html" type="text/ng-template">
      <ion-tabs class="tabs-positive tabs-icon-top">

        <ion-tab title="Home1" icon-on="ion-ios7-filing" icon-off="ion-ios7-filing-outline">
          <ion-nav-view name="home1"></ion-nav-view>
        </ion-tab>

        <ion-tab title="About1" icon-on="ion-ios7-clock" icon-off="ion-ios7-clock-outline">
          <ion-nav-view name="about1"></ion-nav-view>
        </ion-tab>

        <ion-tab title="Settings1" icon-on="ion-ios7-gear" icon-off="ion-ios7-gear-outline">
          <ion-nav-view name="settings1"></ion-nav-view>
        </ion-tab>

      </ion-tabs>
    </script>

    <script id="templates/tabs2.html" type="text/ng-template">
      <ion-tabs class="tabs-positive tabs-icon-top">

        <ion-tab title="Home2" icon-on="ion-ios7-filing" icon-off="ion-ios7-filing-outline">
          <ion-nav-view name="home2"></ion-nav-view>
        </ion-tab>

        <ion-tab title="About2" icon-on="ion-ios7-clock" icon-off="ion-ios7-clock-outline">
          <ion-nav-view name="about2"></ion-nav-view>
        </ion-tab>

        <ion-tab title="Settings2" icon-on="ion-ios7-gear" icon-off="ion-ios7-gear-outline">
          <ion-nav-view name="settings2"></ion-nav-view>
        </ion-tab>

      </ion-tabs>
    </script>
    
    <script id="templates/welcome.html" type="text/ng-template">
      <ion-view view-title="Welcome">
        <ion-content>
          <h1>Welcome Page</h1>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="templates/login.html" type="text/ng-template">
      <ion-view view-title="Login">
        <ion-content>
          <h1>Login Page</h1>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="templates/tabs1-home1.html" type="text/ng-template">
      <ion-view view-title="Home1">
        <ion-content>
          <h1>Home1 Tab</h1>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="templates/tabs1-about1.html" type="text/ng-template">
      <ion-view view-title="About1">
        <ion-content>
          <h1>About1 Tab</h1>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="templates/tabs1-settings1.html" type="text/ng-template">
      <ion-view view-title="Settings1">
        <ion-content>
          <h1>Settings1 Tab</h1>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="templates/tabs2-home2.html" type="text/ng-template">
      <ion-view view-title="Home2">
        <ion-content>
          <h1>Home2 Tab</h1>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="templates/tabs2-about2.html" type="text/ng-template">
      <ion-view view-title="About2">
        <ion-content>
          <h1>About2 Tab</h1>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="templates/tabs2-settings2.html" type="text/ng-template">
      <ion-view view-title="Settings2">
        <ion-content>
          <h1>Settings2 Tab</h1>
        </ion-content>
      </ion-view>
    </script>
   
  </body>
</html>
              
            
!

CSS

              
                .bar-subheader.has-tabs-top{
  top:93px !important;
}

.has-subheader.has-tabs-top{
  top:137px;
}
              
            
!

JS

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

.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
  //$ionicConfigProvider.tabs.position("top");

  $stateProvider
  .state('app', {
    url: "/app",
    abstract: true,
    templateUrl: "templates/menu.html",
    controller: 'AppCtrl'
  })

  .state('app.welcome', {
    url: "/welcome",
    views: {
      'menuContent': {
        templateUrl: "templates/welcome.html",
          controller: 'WelcomeCtrl'
      }
    }
  })
  
  .state('app.login', {
    url: "/login",
    views: {
      'menuContent': {
        templateUrl: "templates/login.html",
          controller: 'LoginCtrl'
      }
    }
  })
  
  .state('app.tabs1', {
    url: "/tabs1",
    views: {
      'menuContent': {
        templateUrl: "templates/tabs1.html"
      }
    }
  })
  
  .state('app.home1', {
    url: "/home1",
    views: {
      'home1': {
        templateUrl: "templates/tabs1-home1.html"
      }
    }
  })
  
  .state('app.about1', {
    url: "/about1",
    views: {
      'about1': {
        templateUrl: "templates/tabs1-about1.html"
      }
    }
  })
  
  .state('app.settings1', {
    url: "/settings1",
    views: {
      'settings1': {
        templateUrl: "templates/tabs1-settings1.html"
      }
    }
  })
  
  .state('app.tabs2', {
    url: "/tabs2",
    views: {
      'menuContent': {
        templateUrl: "templates/tabs2.html"
      }
    }
  })
  
  .state('app.home2', {
    url: "/home2",
    views: {
      'home2': {
        templateUrl: "templates/tabs2-home2.html"
      }
    }
  })
  
  .state('app.about2', {
    url: "/about2",
    views: {
      'about2': {
        templateUrl: "templates/tabs2-about2.html"
      }
    }
  })
  
  .state('app.settings2', {
    url: "/settings2",
    views: {
      'settings2': {
        templateUrl: "templates/tabs2-settings2.html"
      }
    }
  });


  $urlRouterProvider.otherwise("/app/welcome");
  //$ionicConfigProvider.views.maxCache(0);
})

.controller('AppCtrl', function($scope) {
  console.log('AppCtrl');
})

.controller('WelcomeCtrl', function($scope) {
  console.log('WelcomeCtrl');
})

.controller('LoginCtrl', function($scope) {
  console.log('LoginCtrl');
});
              
            
!
999px

Console