Content · Web Development · HTML

HTML directory ARIA Role: Reference and Examples

Understand the directory ARIA role, when it helps accessibility, a clear HTML example and mistakes to avoid.

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

Older code may contain role="directory". This role is deprecated or legacy, so learn to recognize it rather than adding it to a new project.

What this role means


A deprecated role once used for directory-style lists.

This role was meant to describe a deprecated role once used for directory-style lists. Modern HTML provides clearer and more reliable ways to represent the same information.

A modern replacement


<nav aria-label="Topics">
    <ul><li><a href="#html">HTML</a></li></ul>
</nav>

Read the example


The example uses supported semantic HTML instead of relying on the old ARIA role. Readers can understand the content even if an assistive technology does not recognize the legacy role.

Deprecated; use a list with appropriate native navigation semantics.

When to use it


When maintaining old markup, find out what the content actually represents before changing it. Preserve its meaning, links and keyboard behavior during the update.

In an accessibility inspector, compare the accessible role and name with the visible content. The important goal is that both keyboard users and screen-reader users can understand the page.

Try it yourself


Put the example on a practice page and inspect it using your browser accessibility panel. If it includes interactive controls, reach them with Tab and check whether they work without a mouse. Explain whether the semantics come from native HTML or an explicit ARIA role.

Common Beginner Mistakes


  • Reusing deprecated role="directory" in newly written HTML.
  • Deprecated; use a list with appropriate native navigation semantics.
  • Confusing the role announced by a screen reader with the behavior that the browser implements.

Key Takeaways


  • directory is related to a deprecated role once used for directory-style lists.
  • Deprecated; use a list with appropriate native navigation semantics.
  • Native HTML is the first choice; ARIA should clarify meaning, not replace working HTML.
Share this resourceSend this page to someone who may find it useful.