Accessibility in Angular Carousel component

22 Sep 20255 minutes to read

The Carousel component has been designed with WAI-ARIA specifications in mind, implementing WAI-ARIA roles, states, and properties along with comprehensive keyboard support for users of assistive technologies. WAI-ARIA accessibility support is achieved through attributes such as aria-roledescription, aria-label, aria-current, aria-live, role, and aria-hidden. These attributes provide essential information about elements in a document for assistive technology. The component implements keyboard navigation support by following the WAI-ARIA practices and has been thoroughly tested in major screen readers.

The accessibility compliance for the Carousel component is outlined below.

Accessibility Criteria Compatibility
WCAG 2.2 Support Yes
Section 508 Support Yes
Screen Reader Support Yes
Right-To-Left Support Yes
Color Contrast Yes
Mobile Device Support Yes
Keyboard Navigation Support Yes
Accessibility Checker Validation Yes
Axe-core Accessibility Validation Yes
Yes - All features of the component meet the requirement.
Intermediate - Some features of the component do not meet the requirement.
No - The component does not meet the requirement.

ARIA attributes

The Carousel component is designed following WAI-ARIA standards. The Carousel is supported with ARIA accessibility, making it accessible to screen readers and other assistive technology devices. The following list of attributes is applied to the Carousel component.

Roles and Attributes Functionalities
aria-roledescription The role description attribute has been added for the root element (Carousel) and each Carousel slide item (slide).
aria-label Previous, next and play/pause buttons and all indicator elements.
aria-current For the active item indicator element, aria-current is set to true.
aria-hidden For all Carousel elements except the currently visible item, aria-hidden is set to true.
aria-live For Carousel items element, when autoPlay is true, aria-live is set to off; when autoPlay is false, aria-live is set to polite.
aria-role For Carousel slide item, aria-role has been grouped.

Keyboard interaction

All Carousel actions can be controlled via keyboard through the allowKeyboardInteraction property, which is enabled by default. To disable the default keyboard interactions, set this property to false. This is particularly useful when the carousel contains input elements, as pressing arrow keys might cause unexpected carousel movement. By disabling keyboard interaction, the carousel remains static, allowing users to focus on input fields without interruptions.

This component implements keyboard navigation support by following WAI-ARIA practices. Once focused on the active Carousel element, the following key combinations can be used to interact with the Carousel.

Key Description
Alt + J Keys to focus the Carousel component (done at application end).
Arrows Keys to navigate between slides.
Home To navigate to the first slide.
End To navigate to the last slide.
Space To play/pause the slide transitions.
Enter To perform the respective action on its focus.
Tab To Move focus through the interactive elements.
Shift + Tab To Move focus through the interactive elements.

Ensuring accessibility

The Carousel component’s accessibility levels are ensured through accessibility-checker and axe-core software tools during automated testing.

The accessibility compliance of the Carousel component is demonstrated in the following sample. Open the sample in a new window to evaluate the accessibility of the Carousel component with accessibility tools.

See also