Non-interactive DOM elements should usually not be given interactive ARIA roles. Doing so changes how assistive technologies announce the element without giving it the native behavior users expect.
For example, <div role="button"> is announced as a button, but it does not automatically get the keyboard support, focus
behavior, or activation semantics of a real <button>. This mismatch can confuse users and make the page less accessible.
In most cases, prefer native interactive elements instead of assigning interactive roles to non-interactive markup.
According to the ARIA in HTML conformance table, some HTML elements may use specific ARIA roles without violating the HTML specification. Here are some examples:
<fieldset role="radiogroup"><ul role="menu"><li role="menuitem">Open</li></ul><ol role="tablist"><li role="tab">Home</li></ol><table role="grid">For some elements, such as <table>, the specification allows a broader set of roles than the examples above. See the ARIA in HTML conformance table for the full list.
Use a native interactive element whenever possible. For example, replace <li role="button"> with a real
<button> when the content is meant to behave like a button.
Keep an interactive ARIA role on a non-interactive element only when the ARIA in HTML specification explicitly allows that composite-widget
pairing, such as <fieldset role="radiogroup"> or <ul role="tablist">.
function myListElement() {
return <li role="button">Foo</li>; // Noncompliant; "li" isn't interactive, but "button" is
}
function myListElement() {
return <button type="button">Foo</button>;
}