Why is this an issue?

ARIA (Accessible Rich Internet Applications) roles are used to make web content and web applications more accessible to people with disabilities. However, you should not use an ARIA role on a generic element (like span or div) if there is a semantic HTML tag with similar functionality, just use that tag instead.

For example, instead of using a div element with a button role (<div role="button">Click me</div>), you should just use a button element (<button>Click me</button>).

Semantic HTML tags are generally preferred over ARIA roles for accessibility due to their built-in functionality, universal support by browsers and assistive technologies, simplicity, and maintainability. They come with inherent behaviors and keyboard interactions, reducing the need for additional JavaScript. Semantic HTML also enhances SEO by helping search engines better understand the content and structure of web pages. While ARIA roles are useful, they should be considered a last resort when no suitable HTML element can provide the required behavior or semantics.

<div role="button" onClick={handleClick} /* Noncompliant */>Click me</div>

Replace the ARIA role with an appropriate HTML tag.

<button onClick={handleClick}>Click me</button>

Exceptions

Inline SVG elements with role="img" are not raised when they already expose an accessible name through a non-empty aria-label, aria-labelledby, or direct <title> child. This is a valid accessibility pattern for icon components that need to stay inline for styling or animation.

<svg role="img" aria-label="Settings" viewBox="0 0 24 24">
  <path d="M10 10" />
</svg>

<span id="arrow-label" hidden>Arrow Down</span>
<svg role="img" aria-labelledby="arrow-label" viewBox="0 0 24 24">
  <path d="M12 4v16" />
</svg>

<svg role="img" viewBox="0 0 24 24">
  <title>Arrow Down</title>
  <path d="M12 4v16" />
</svg>

Resources

Documentation

Standards