Skip to content

nonInteractiveElementRoles

Reports non-interactive elements with interactive ARIA roles.

✅ This rule is included in the jsx logical preset.

Non-interactive HTML elements such as <div> and <span> are not given interactions such as Tab focus by browsers. Giving a non-interactive HTMl element an interactive role will not fill in those interactions, and so causes accessibility issues on pages that do so. It’s generally more accessible to use native interactive elements instead.

<h1 role="button" />
<div role="link" />
<img role="checkbox" />

If you are using a framework that fully recreates browser interaction events for elements, you can safely disable this rule. However, native browser interactions are exceedingly difficult to fully recreate. It is strongly recommended to use native interactive elements instead.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.