Skip to content

tabIndexPositiveValues

Reports positive tabIndex values.

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

Positive tabIndex values disrupt the natural tab order and make keyboard navigation unpredictable for users. Instead, use tabIndex="0" to include elements in the natural tab order, or tabIndex="-1" to make them programmatically focusable.

This is required for WCAG 2.4.3 compliance.

<
any
span
tabIndex: string
tabIndex
="5">content</
any
span
>
<
any
span
tabIndex: string
tabIndex
="1">content</
any
span
>
<
any
div
tabIndex: number
tabIndex
={3}>content</
any
div
>

If you are managing tab orders with a well-defined focus management system that handles positive tabIndex values well, this rule may not be applicable.

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