Skip to content

Carousel pattern: Add guidance for inert off-screen slides and reduced-motion auto-rotation #3476

Open

Description

@patrickfox

Summary

The Carousel pattern explains why off-screen slides and automatic rotation cause problems for assistive technology users, but the WAI-ARIA Roles, States, and Properties section does not say how to handle either one. I propose two additions.

1. Off-screen and partially visible slides

The "About This Pattern" section notes that the screen reader experience can be confusing and disorienting when slides that are not visible are incorrectly hidden, for example by being positioned off-screen. However, no bullet under "Basic carousel elements" says how slides that are not displayed should be hidden.

This matters more for carousels that show several slides at once, or that show part of the next slide as a visual cue. In these designs, display: none is often not an option, so authors move slides off-screen or clip them. The result is content that screen reader and keyboard users can still reach but cannot see.

The inert attribute handles both problems in one step. It removes content from the accessibility tree and from the Tab sequence, and it is supported in all major browsers.

Proposed addition (after the bullet on slide container roles):

Each slide container that is not currently displayed, including any slide that is only partially visible, has the inert attribute. This removes the slide's content from both the accessibility tree and the page Tab sequence. Note: if slides that are not displayed remain reachable, screen reader and keyboard users can move into content they cannot see, which makes the carousel cumbersome and disorienting to navigate.

2. Respecting reduced-motion preferences

The list of features for carousels that can rotate automatically covers rotation controls and stopping on focus or hover. It does not cover users who have already asked their operating system to reduce motion. Starting auto-rotation for these users ignores a preference they set on purpose, and automatic motion is the kind of effect that preference is meant to prevent.

Proposed addition (to the "If the carousel can automatically rotate, it also:" list):

Does not start rotating automatically when the user has indicated a preference for reduced motion, e.g., via the prefers-reduced-motion media feature.

Related

Examples

The two carousel examples probably need matching updates, especially for the reduced-motion check. I am happy to do that in a follow-up PR once the pattern wording is settled.

Activity

  1. added a commit that references this issue on Oct 29, 2026
    43576f7
  2. mcking65 commented on Nov 11, 2026

    @mcking65
    Contributor

    @patrickfox

    Note that the APG pattern pages do not include coding techniques, such as using inert for hidden carousel slides. In some special cases, a coding technique might be mentioned in a note in the roles, states, and properties section of the pattern if it is essential to the pattern. Modal dialog pattern is a good example of that.

    With the exception of specifying ARIA roles, states, and props, The pattern is focused on the UX. With that in mind, your suggestion to include support for reduced motion settings addresses an important oversight. That is an important UX feature that should be included in the about section of the pattern.

    The current examples do support the CSS media feature for prefers reduced motion.

    Perhaps one of the examples could use inert instead of display:none to illustrate an alternative approach. It seems like an approach that could have some distinct advantages.

    It would be helpful if you would like to submit a PR to add reduced motion support to the pattern.

    In addition, if you have ideas about using inert in one of the examples, please share those as well.

  3. patrickfox commented on Nov 13, 2026

    @patrickfox
    Author

    Thank you @mcking65.

    For clarity, I have split this into two separate PRs, both of which are minor content updates:

    1. Carousel pattern: Hide off-screen slides from assistive technologies #3486: Hide off-screen carousel slides from assistive technologies
    2. Carousel pattern: Respect the user's prefers-reduced-motion preference #3485: Respect the user's reduced-motion preference

    For #3486 (hiding off-screen slides), I have removed the reference to the inert attribute so the bullet describes the expected outcome without a specific technique. It now reads:

    Each slide container that is not currently displayed, including any slide that is only partially visible, is hidden from assistive technologies and its content is not included in the page Tab sequence. Note: if slides that are not displayed remain reachable, screen reader and keyboard users can move into content they cannot see, which makes the carousel cumbersome and disorienting to navigate.

    For #BBBB (reduced motion), I have added a bullet to the "If the carousel can automatically rotate, it also:" list in the About This Pattern section:

    Does not start rotating automatically when the user has indicated a preference for reduced motion, e.g., via the prefers-reduced-motion media feature.

    Regarding the current carousel examples, using inert vs. display: none; is effectively the same thing: the off-screen slides are not visible and are properly hidden from AT. I often see far more complex examples of carousels out in the wild, though, where there may be twenty slides in a carousel and only five of them are visible. And I frequently see that are not hidden from AT, which creates a more cumbersome experience. I think there's an opportunity here to provide additional carousel examples that are a bit more complex (and realistic), but I will follow up with another proposal for those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions