Tutorialsplane

Angular Material Side Nav


Angular Material Side Nav: Sidenav is Angular Material component that is opened and closed and opened programatically. It is very easy to create side nav in Angular Material. Here in this tutorial we are going to explain how you can create Side Nav In Angular Material. You can also use our online editor to edit and run the code online.


Angular Material Side Nav | Side Menu Example

md-sidenav Directive and $mdSidenav service is used to create Side Nav, let us first create simple Side Nav to understand how it works.

Angular Material Side Nav | Left Side Menu Example


   
      
      
      
      
      
      
	  
	 
      
      
   
   
  <div ng-controller="MyController as ctrl" ng-cloak=""> 
  <md-content layout-padding="">  
     <md-sidenav md-component-id="left" class="md-sidenav-left">
    Left Nav
  </md-sidenav>
  <md-content>
    <md-button ng-click="openLeftNav()">
      Click to Open Left Menu
    </md-button>
  </md-content>
  </md-content></div>
  
                                                                                                                                                                                                                                                               
Try It On →

Note : $mdSidenav service must be imported in controller before using the side nav so make sure you have imported it properly.

If you run the above example it will produce output something like this –

Options Available

Following options are available for side nav which you can use as per your need-

Learn Angular Material