Default drawer
The default drawer has 2 option you can choose from.
These options are full-height and clipped
The full-height will cover the entire screen height while the clipped option remains below the app bar.
In order to make a navigation drawer item active you need to add the
.drawer__item--active
class to the .drawer__item
element.
When this class is added to a sub menu item it makes sure the sub menu is opened automatically.
Basic markup for the navigation drawer
<nav class="drawer" id="drawer">
<ul>
<li><a href="../" class="drawer__item"><span class="drawer__item__content">Home</span></a></li>
<li><a href="../getting-started.html" class="drawer__item"><span class="drawer__item__content">Getting started</span></a></li>
<li>
<div class="drawer__item drawer__item__parent"><span class="drawer__item__content">Layout</span></div>
<ul class="drawer__item__children">
<li><a href="../layout/grid.html" class="drawer__item"><span class="drawer__item__content">Grid</span></a></li>
<li><a href="../layout/shadow.html" class="drawer__item"><span class="drawer__item__content">Shadows</span></a></li>
</ul>
</li>
</ul>
</nav>
Active menu item
<li>
<a href="./navigation-drawer.html" class="drawer__item drawer__item--active">
<span class="drawer__item__content">Navigation drawer</span>
</a>
</li>
Fixed
It is also possible to use a fixed drawer.
With the fixed drawer the drawer remains visible on larger screen sizes.
This also means that the content is pushed over more.
In order to use the fixed drawer you need to change a couple of elements.
On the drawer you need to add the .drawer--fixed
class.
On the .container
you need to add the .container-drawer--fixed
class.
On the .app-bar
you need to add the .app-bar-drawer--fixed
class.
<nav class="drawer drawer--fixed" id="drawer">
<main class="container container-drawer--fixed">
<header class="app-bar app-bar-drawer--fixed">