UI components
Side navigation
Hierarchical, vertical navigation to place at the side of a page.
Single level
Two levels
Three levels
<div class="usa-width-one-whole">
<section class="usa-grid">
<div class="usa-width-one-third">
<h6 class="usa-heading-alt">Single level</h6>
<nav>
<ul class="usa-sidenav-list">
<li>
<a href="" class="usa-current">
Current page
</a>
</li>
<li>
<a href="">
Parent link
</a>
</li>
<li>
<a href="">
Parent link
</a>
</li>
</ul>
</nav>
</div>
<div class="usa-width-one-third">
<h6 class="usa-heading-alt">Two levels</h6>
<nav>
<ul class="usa-sidenav-list">
<li>
<a href="">
Parent link
</a>
</li>
<li>
<a href="" class="usa-current">
Current page
</a>
<ul class="usa-sidenav-sub_list">
<li>
<a href="">
Child link
</a>
</li>
<li>
<a href="">
Child link
</a>
</li>
<li>
<a href="">
Child link
</a>
</li>
<li>
<a href="">
Child link
</a>
</li>
<li>
<a href="" class="usa-current">
Child link
</a>
</li>
</ul>
</li>
<li>
<a href="">
Parent link
</a>
</li>
</ul>
</nav>
</div>
<div class="usa-width-one-third">
<h6 class="usa-heading-alt">Three levels</h6>
<nav>
<ul class="usa-sidenav-list">
<li>
<a href="">
Parent link
</a>
</li>
<li>
<a href="" class="usa-current">
Current page
</a>
<ul class="usa-sidenav-sub_list">
<li>
<a href="">
Child link
</a>
</li>
<li>
<a href="">
Child link
</a>
<ul class="usa-sidenav-sub_list">
<li>
<a href="">
Grandchild link
</a>
</li>
<li>
<a href="">
Grandchild link
</a>
</li>
<li>
<a href="" class="usa-current">
Grandchild link
</a>
</li>
</ul>
</li>
<li>
<a href="">
Child link
</a>
</li>
<li>
<a href="">
Child link
</a>
</li>
<li>
<a href="">
Child link
</a>
</li>
</ul>
</li>
<li>
<a href="">
Parent link
</a>
</li>
</ul>
</nav>
</div>
</section>
</div>
Implementation
- The width of the current menu item’s highlight border is set with the
$sidenav-current-border-width
variable.
Accessibility
- Ensure the side navigational system is keyboard accessible. Users should be able to tab through each link.
Usability
When to use
- To display a navigational hierarchy with one to three levels.
- To display the “sub-navigation” within a section of the website.
When to consider something else
- If the site has fewer than five pages, consider organizing the page without a navigational hierarchy.
- If your page already has a horizontal and vertical navigation bar, consider ways to simplify your navigation system.
- If your content is within a frame or sub-area of a page, consider ways to simplify your navigation system.
Guidance
- Indicate where a user is within the navigational hierarchy. Use the “active” state to show users which page they have navigated to.
- Keep the navigation links short. They can be shorter derivatives of page titles themselves.
- If the navigation hierarchy is too long, users may miss items at the bottom. If it’s too deep, users may miss items that require too many clicks. Usability test to find the right balance between breadth and depth.