Skip to content

roleSupportedAriaProps

Reports ARIA properties that are not supported by an element's role.

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

Elements with ARIA roles should only use ARIA properties that are supported by that role. Each ARIA role has a specific set of supported properties defined in the WAI-ARIA specification. Using ARIA properties that are not supported by a role can confuse assistive technologies and lead to unexpected behavior.

For example, the checkbox role supports properties like aria-checked and aria-required, but not aria-selected. Similarly, the button role supports aria-pressed and aria-expanded, but not aria-checked.

This is required for WCAG 4.1.2 compliance.

<
JSX.IntrinsicElements.div: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>
div
HTMLAttributes<HTMLDivElement>.role?: AriaRole | undefined
role
="button"
AriaAttributes["aria-checked"]?: boolean | "true" | "false" | "mixed" | undefined

Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.

@seearia-pressed

@seearia-selected.

aria-checked
="true" />
<
JSX.IntrinsicElements.div: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>
div
HTMLAttributes<HTMLDivElement>.role?: AriaRole | undefined
role
="link"
AriaAttributes["aria-selected"]?: Booleanish | undefined

Indicates the current "selected" state of various widgets.

@seearia-checked

@seearia-pressed.

aria-selected
="true" />
<
JSX.IntrinsicElements.button: DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>
button
AriaAttributes["aria-checked"]?: boolean | "false" | "mixed" | "true" | undefined

Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.

@seearia-pressed

@seearia-selected.

aria-checked
="false" />

If you use a framework that automatically changes ARIA properties from custom invalid ones to correct roles, you might need to disable this rule.

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