Angular Bootstrap sidenav MDB Pro component

SideNav also called Sidebar or simply - Side Menu, is not Bootstraps native component. It�s common for Material Design form of navigation, which quickly became a standard in modern web design.

By virtue of its clarity and simplicity it remarkably increases User Experience. It allows you to navigate through small applications as well as vast portals swiftly. Multiple link embedding functionality enables you to implement more advanced content categorisation, which is almost essential within bigger projects.

Thanks to MDB you can easily implement SideNav in your own projects, by using one of various, alluring Side Menus.

Navigation on the left is a live demo of SideNav.


How it looks on a mobile device:



SideNav examples

Click on the images below to see live preview



Basic usage


<!-- SideNav slide-out button -->
<a (click)="sidenav.toggle()" class="btn btn-primary p-3 button-collapse"><i class="fa fa-bars"></i></a>
<!--/. SideNav slide-out button -->

<!-- Sidebar navigation -->
<mdb-sidenav #sidenav class="fixed" [fixed]="true">
    <!-- Logo -->
    <li>
        <div class="logo-wrapper waves-light">
            <a href="#"><img src="http://mdbootstrap.com/img/logo/mdb-transparent.png" class="img-fluid flex-center"></a>
        </div>
    </li>
    <!--/. Logo -->
    <!--Social-->
    <li>
        <ul class="social">
            <li><a class="icons-sm fb-ic"><i class="fa fa-facebook"> </i></a></li>
            <li><a class="icons-sm pin-ic"><i class="fa fa-pinterest"> </i></a></li>
            <li><a class="icons-sm gplus-ic"><i class="fa fa-google-plus"> </i></a></li>
            <li><a class="icons-sm tw-ic"><i class="fa fa-twitter"> </i></a></li>
        </ul>
    </li>
    <!--/Social-->
    <!--Search Form-->
    <li>
        <form class="search-form" role="search">
            <div class="form-group md-form waves-light" mdbWavesEffect>
                <input type="text" class="form-control" placeholder="Search">
            </div>
        </form>
    </li>
    <!--/.Search Form-->
    <!-- Side navigation links -->
    <li>
        <ul class="collapsible collapsible-accordion">
            <mdb-squeezebox [multiple]="false" aria-multiselectable="false">

                <!-- Collapsible link -->
                <mdb-item>
                    <mdb-item-head mdbWavesEffect><i class="fa fa-chevron-right"></i> Collapsible menu</mdb-item-head>
                    <mdb-item-body>
                        <ul>
                            <li><a href="#" class="waves-effect" mdbWavesEffect>Link 1</a></li>
                            <li><a href="#" class="waves-effect" mdbWavesEffect>Link 2</a></li>
                        </ul>
                    </mdb-item-body>
                </mdb-item>

                <!-- Simple link -->
                <mdb-item class="no-collase">
                    <mdb-item-head mdbWavesEffect><i class="fa fa-hand-pointer-o"></i> Simple link</mdb-item-head>
                    <mdb-item-body></mdb-item-body>
                </mdb-item>

                <!-- Collapsible link -->
                <mdb-item>
                    <mdb-item-head mdbWavesEffect><i class="fa fa-eye"></i> Collapsible menu 2</mdb-item-head>
                    <mdb-item-body>
                        <ul>
                            <li><a href="#" class="waves-effect" mdbWavesEffect>Link 1</a></li>
                            <li><a href="#" class="waves-effect" mdbWavesEffect>Link 2</a></li>
                        </ul>
                    </mdb-item-body>
                </mdb-item>

                 <!-- Simple link -->
                 <mdb-item class="no-collase">
                    <mdb-item-head mdbWavesEffect><i class="fa fa-diamond"></i> Simple link 2</mdb-item-head>
                    <mdb-item-body></mdb-item-body>
                </mdb-item>
                
            </mdb-squeezebox>
        </ul>
    </li>
    <!--/. Side navigation links -->
    <div class="sidenav-bg mask-strong"></div>
</mdb-sidenav>
<!--/. Sidebar navigation -->

Methods:


// Show sideNav
sidenav.show();

// Hide sideNav
sidenav.hide();

// Toggle sideNav
sidenav.toggle();

Fixed / non-fixed SideNav

Use [fixed]="true" and class .fixed to have the sideNav be fixed and open on large screens and hides to the regular functionality on smaller screens. Our sideNav on the left is an example of fixed SideNav.

If you want to hide your SideNav by default just remove .fixed and set [fixed] to true class from the SideNav.


<mdb-sidenav #sidenav [fixed]="true">

Required padding-left when using .fixedclass

If you are planning on using this you will have to offset your content by the width of the side menu. Place the padding on where the offset content will be, which in our case is in header, main and footer.


header, main, footer {
  padding-left: 240px;
}

@media only screen and (max-width : 992px) {
  header, main, footer {
    padding-left: 0;
  }
}

Note: Instead of adding required padding via CSS you can use one of our predefined Navigation Layouts


Customize SideNav

Changing the color

You can use each of 300 colors from our Material Palette just by adding a proper color class.

In the example below we've added a .purple color class and .darken-4 to make the color 4 levels darker.


<!-- SideNav Menu -->
<mdb-sidenav #sidenav class="purple darken-4">

Light /dark background

Depending on light or dark background you may need to set a proper contrast for links and other SideNav's elements.

Use .side-nav-light for light backgrounds.


<mdb-sidenav #sidenav" class="side-nav-light">

Gradient / images / masks

For gradients, images or masks use our predefined Skins


Advanced usage

MDB provides you multiple useful, ready-to-use page layouts with various predefined navigation types.

Click buttons below to learn more:

Predefined layouts Predefined skins