Skip to main content
No Result Found

role-required-image

Rule Severity : Critical

Description

Images must have the correct ARIA role assigned to ensure they are properly interpreted by assistive technologies.

Assistive technologies use ARIA roles to determine how elements are presented to users. If an image is assigned an incorrect role or lacks a role attribute, assistive technologies may misinterpret or ignore the image, leading to accessibility issues.

Examples

The following example incorrectly assigns the presentation role to an image, which may cause assistive technologies to miss or misinterpret the image.

Incorrect Sample
Copy icon Copy

The following example correctly assigns the img role to the image, ensuring that assistive technologies properly interpret the image.

Correct Sample
Copy icon Copy

How to fix?

  • Assign role="img" to non-decorative images.
  • Add meaningful alternative text to describe the image.
  • Use role="presentation" for purely decorative images to hide them from screen readers.

References

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle