<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="" class="usa-current">
      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>

                    <li>
                        <a href="">
      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="">
      Another link
    </a>

    </li>

</ul>

There are no notes for this item.

{% macro nav_list(links, subclass) %}
  {% for item in links %}
  <li>
    <a href="{{ item.href }}"{% if item.current %} class="usa-current"{% endif %}>
      {{ item.text }}
    </a>
    {% if item.current and item.links %}
    <ul class="{{ subclass }}">
      {{ nav_list(item.links, subclass) }}
    </ul>
    {% endif %}
  </li>
  {% endfor %}
{% endmacro %}

<ul class="usa-sidenav-list">
  {{ nav_list(sidenav.links, 'usa-sidenav-sub_list') }}
</ul>
package:
  name: uswds
  version: 1.3.0
uswds:
  path: ../../dist
sidenav:
  links:
    - text: Parent link
    - text: Current page
      current: true
      links:
        - text: Child link
        - text: Child link
          current: true
          links:
            - text: Grandchild link
            - text: Grandchild link
            - text: Grandchild link
              current: true
            - text: Grandchild link
        - text: Child link
        - text: Child link
        - text: Child link
    - text: Another link