Components

Side navigation

Hierarchical, vertical navigation to place at the side of a page.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<div class="grid-row grid-gap"><div class="tablet:grid-col-4">
      <h6 class="usa-heading-alt">Single level</h6><nav aria-label="Secondary navigation">
  <ul class="usa-sidenav">
    <li class="usa-sidenav__item">
    <a href="" class="usa-current">Current page</a>
  </li><li class="usa-sidenav__item">
    <a href="">Parent link</a>
  </li><li class="usa-sidenav__item">
    <a href="">Parent link</a>
  </li>
  </ul>
</nav>
</div><div class="tablet:grid-col-4">
      <h6 class="usa-heading-alt">Two levels</h6><nav aria-label="Secondary navigation">
  <ul class="usa-sidenav">
    <li class="usa-sidenav__item">
    <a href="">Parent link</a>
  </li><li class="usa-sidenav__item">
    <a href="" class="usa-current">Current page</a><ul class="usa-sidenav__sublist">
      <li class="usa-sidenav__item">
    <a href="">Child link</a>
  </li><li class="usa-sidenav__item">
    <a href="">Child link</a>
  </li><li class="usa-sidenav__item">
    <a href="">Child link</a>
  </li><li class="usa-sidenav__item">
    <a href="">Child link</a>
  </li><li class="usa-sidenav__item">
    <a href="" class="usa-current">Child link</a>
  </li>
    </ul>
  </li><li class="usa-sidenav__item">
    <a href="">Parent link</a>
  </li>
  </ul>
</nav>
</div><div class="tablet:grid-col-4">
      <h6 class="usa-heading-alt">Three levels</h6><nav aria-label="Secondary navigation">
  <ul class="usa-sidenav">
    <li class="usa-sidenav__item">
    <a href="">Parent link</a>
  </li><li class="usa-sidenav__item">
    <a href="" class="usa-current">Current page</a><ul class="usa-sidenav__sublist">
      <li class="usa-sidenav__item">
    <a href="">Child link</a>
  </li><li class="usa-sidenav__item">
    <a href="">Child link</a><ul class="usa-sidenav__sublist">
      <li class="usa-sidenav__item">
    <a href="">Grandchild link</a>
  </li><li class="usa-sidenav__item">
    <a href="">Grandchild link</a>
  </li><li class="usa-sidenav__item">
    <a href="" class="usa-current">Grandchild link</a>
  </li>
    </ul>
  </li><li class="usa-sidenav__item">
    <a href="">Child link</a>
  </li><li class="usa-sidenav__item">
    <a href="">Child link</a>
  </li><li class="usa-sidenav__item">
    <a href="">Child link</a>
  </li>
    </ul>
  </li><li class="usa-sidenav__item">
    <a href="">Parent link</a>
  </li>
  </ul>
</nav>
</div></div>

When to use the side navigation component

  • 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

  • Small site. If the site has fewer than five pages, consider organizing the page without a navigational hierarchy.
  • Existing navigation. If your page already has a horizontal and vertical navigation bar, consider ways to simplify your navigation system.

Usability guidance

  • Show the current page. 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.
  • Always test your navigation. 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.

Accessibility

  • Ensure the side navigational system is keyboard accessible. Users should be able to tab through each link.

Implementation

  • The width of the current menu item’s highlight border is set with the $theme-sidenav-current-border-width variable.

Package information

  • Package usage: @import usa-sidenav
  • Requires: required, global