Sidenav
Angular Bootstrap 5 Sidenav component
The side navigation component provides an easy way to navigate through your website.
Note: Read the API tab to find all available options and advanced customization
Basic example
In the basic version, the side navigation will appear over your website's content after clicking on a toggler.
Note: Use show
and hide
methods to toggle navigation with TypeScript.
Positioning
While using the side
and push
modes, you can specify the selector for your page's content - this way, the component will automatically update paddings and margins.
Select mode:
Colors example
Setting the color
option will change the background and font color of active/hovered links and categories.
Note: This option works for MDB 5 Angular main colors - primary, secondary, warning, danger, success, info, dark and light.
Select color:
Inner scroll
Passing a selector of an inner element to the scrollContainer
option will initialize MDB scrollbar only on this container (by default it's initialized on the sidenav component).
Menu item scroll
You can use custom styles and our Scrollbar to add inner scroll for menu items.
Slim example
You can hide/show elements in the slim mode by setting slim
option on them - depending on value they will be either visible only in a slim or an expanded mode. Elements without this attribute will appear in both modes.
Accordion example
Using accordion
option will allow expanding only one category at once.
Groups
You can use more than one menu inside the side navigation - in this case, accordions will be independent of one another. Just add mdbSidenavMenu
directive to each menu element.
Right
Place the navigation on the other side by setting the right
option to true
.
Active links
Use Angular routerLinkActive
directive to add .active
class to the navigation element that leads to the active route. Navigation menu will automatically expand to show active link.
Full-screen examples
The following examples show various settings of the side navigation component in a full-screen mode.
1. Basic side navigation
Click the toggler to show the navigation (over mode).
2. Side navigation with a mode transition
Resize the window to change the mode from side
to over
.
3. Slim side navigation (dark)
Non-expandable slim sidenav with a dark background and custom width.
4. MDB Navigation
Navigation template based on MDB documentation with the following settings:
- Hidden on screens smaller then
1400px
-
padding-left: 240px
added via CSS to theheader
andmain
on the screens larger then1400px
to push the content out of the sidenav area - Sidenav toggler added to the Navbar and hidden on screen larger then
1400px
- On screens smaller then
1400px
sidenav mode changes fromside
toover
.
Sidenav small and with categories
Related resources
Access restricted
To view this section you must have an active PRO account
Log in to your account or purchase an MDB5 PRO subscription if you don't have one.
Login Buy MDB Pro