Skip to content

nonInteractiveElementInteractions

Reports non-interactive elements with interactive event handlers.

✅ This rule is included in the jsx logical and logicalStrict presets.

Non-interactive HTML elements and non-interactive ARIA roles indicate content and containers in the user interface. These elements should not have interactive event handlers because they are not designed to be interactive.

Non-interactive elements include <main>, <area>, <h1> through <h6>, <p>, <img>, <li>, <ul>, and <ol>. Non-interactive ARIA roles include article, banner, complementary, img, listitem, main, navigation, region, and tooltip.

When you need to add interactivity, use native interactive elements like <button> or <a>, or add an appropriate interactive role to the element.

This is required for WCAG 4.1.2 compliance.

<
any
h1
onClick: () => void
onClick
={() => {}}>Heading</
any
h1
>
<
any
main
onKeyDown: () => void
onKeyDown
={
const handler: () => void
handler
}>Content</
any
main
>;
<
any
img
onClick: () => void
onClick
={
const handleClick: () => void
handleClick
}
src: string
src
="image.png" />;
<
any
section
onClick: () => void
onClick
={
const handler: () => void
handler
}
role: string
role
="article" />;

If you are using a framework that automatically handles accessibility for non-interactive elements with event handlers, you can disable this rule.

Made with ❤️‍🔥 around the world by the Flint team and contributors.