Repository navigation
il section nav
Jon Gunderson edited this page Nov 8, 2021
·
8 revisions
Web Component: <il-section-nav>
Dev Codepen: https://codepen.io/il-toolkit/pen/QWveprz
...
<button class="il-section-nav__toggle">
Toggle section navigation menu
<svg aria-label=""
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512"
role="presentation">
<path d="M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z">
</path>
</svg>
</button>
...
- Accessible name for
buttoncomes from the text content, but could usearia-labelif you don't want to deal with the hiding text content. -
aria-expandedon button element to indicate if navigation is visible or not. - Use
aria-controls="IDREF"to the container of the navigational links. - Use
aria-hidden="true"instead ofrole="presentation"to make sure the entire SVG is ignored by assistive technologies. -
aria-labelattribute is not need onsvgelement. - Not clear from the code pen how the
navelement defines the navigation landmark region, will also want to allow it to have an accessible name, maybe with a default value "Page Sections" or something not sure the exact potential usage of the component.