Angular side menu with Bootstrap navbar

Creating the sidebar with Angular and Bootstrap navbar

The ng-bs-navbar is an Angular directive that can be used for creating the navbar based on Bootstrap, as well as it includes a handy sidebar.

You may also place the icons from the materialIcon with the menu items.

Developer page Download plug-in

How to setup this Angular directive?

You need to setup the routes with navbar in the JS code where you may also set the icons. See the navbar.js and ng-bs-navbar.js files that download with the zipped file.

Include the dependency files:

<script type=”text/javascript” src=”bower_components/ng-bs-navbar/dist/ng-bs-navbar.js”></script>
<link rel=”stylesheet” href=”bower_components/ng-bs-navbar/dist/ng-bs-navbar.css” type=”text/css” />
<link rel=”stylesheet” href=”bower_components/ng-bs-navbar/dist/ng-bs-navbar-theme-dark.css” type=”text/css” />
<link href=”” rel=”stylesheet”>

See the demo and code below for learning how to use the code.

A demo with dark theme

In this demo, the dark theme is used for the menus. You can see the position heading with two buttons. Upon pressing the top, the position of the left menu will change to the top. Similarly, you may use the Condensed or Full view of the menu by pressing the respective button:

Angular sidebar

See the online demo and code


<!doctype html>
<html ng-app="ng-bs-navbar-example">
    <meta charset="utf-8">
    <link href=""
    <link rel="stylesheet" href="">

    <link rel="stylesheet" href="css/ang-navbar/ng-bs-navbar.css" type="text/css" />
    <link rel="stylesheet" href="css/ang-navbar/ng-bs-navbar-theme-dark.css" type="text/css" />

    <link rel="stylesheet" href="css/ang-navbar/example.css" type="text/css" />


  <navbar position="left"></navbar>

  <div class="main" ng-controller="ExampleController">
    <h1>ng-bs-navbar example</h1>

    <p>Examples on how to interactive with the navbar</p>

    <div class="btn-group">
      <a class="btn btn-primary" ng-click="position = 'left'">Left</a>
      <a class="btn btn-primary" ng-click="position = 'top'">Top</a>

    <h4>Size (left only)</h4>

    <p>Setting for the navbar when positioned to the left <i>and right in the future</i></p>
    <div class="btn-group">
      <a class="btn btn-primary" ng-click="size = 'condensed'">Condensed</a>
      <a class="btn btn-primary" ng-click="size = 'full'">Full</a>

    <h3>Current Controller</h3>
    <div class="well" ng-view></div>

  <script src=""></script>
  <script type="text/javascript" src=""></script>
  <script type="text/javascript" src=""></script>

  <script type="text/javascript" src="js/ang-navbar/ng-bs-navbar.js"></script>
  <script type="text/javascript" src="js/ang-navbar/navbar.js"></script>

A demo of light color theme

For the above demo, the ng-bs-navbar-theme-dark.css file was used for creating the darkish theme. You may customize that file or add your own style to match the theme of the left or top navigation bar with the rest of the website design.

For this demo, the ng-bs-navbar-theme-dark.css is removed and the light color scheme is used as follows:

Angular top bar

Learn more about this directive here.