Skip to main content
No Result Found

carousel-region

Ensure that carousels and their elements are properly contained using ARIA role="region" or a <section> tag.

Rule Severity : Moderate

Description

Carousels must be enclosed within a role ="region" or a <section> element.

When carousels are not contained within a landmark region, screen readers and other assistive technologies may not provide sufficient context to users. This can make navigation difficult for users with disabilities, especially when dynamic content is involved. Adding landmarks helps users bypass blocks of content that are not relevant to them and quickly jump to relevant content.

Examples

The following example code lacks the role="region" or <section> wrapper for navigation buttons and images.

Incorrect Sample Code
Copy icon Copy

The following sample code corrects the issue in the earlier example by enclosing the carousel with a <section> tag:

Correct Sample Code - aria-label
Copy icon Copy

You can also solve the issue by using role="region" as follows:

Correct Sample Code - aria-labelledby
Copy icon Copy

How to fix?

Ensure that the carousel is enclosed within an appropriate landmark region using either:

  • An HTML <section> element along with an aria-label or aria-labelledby attribute.
  • An element with role="region" applied, along with an aria-label or aria-labelledby attribute.

Reference

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