Skip to content

il section nav

Jon Gunderson edited this page Nov 8, 2021 · 8 revisions

Accessibility Issues

Web Component: <il-section-nav>

Dev Codepen: https://codepen.io/il-toolkit/pen/QWveprz

Rendered Shadow DOM Code

...
  <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>
...

Accessibility Considerations

  • Accessible name for button comes from the text content, but could use aria-label if you don't want to deal with the hiding text content.
  • aria-expanded on 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 of role="presentation" to make sure the entire SVG is ignored by assistive technologies.
  • aria-label attribute is not need on svg element.
  • Not clear from the code pen how the nav element 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.

Clone this wiki locally