Accessibility in React Range Slider component
24 Jan 20244 minutes to read
The Range Slider component followed the accessibility guidelines and standards, including ADA, Section 508, WCAG 2.2 standards, and WCAG roles that are commonly used to evaluate accessibility.
The accessibility compliance for the Range Slider component is outlined below.
Accessibility Criteria | Compatibility |
---|---|
WCAG 2.2 Support | |
Section 508 Support | |
Screen Reader Support | |
Right-To-Left Support | |
Color Contrast | |
Mobile Device Support | |
Keyboard Navigation Support | |
Accessibility Checker Validation | |
Axe-core Accessibility Validation |
WAI-ARIA attributes
The Range Slider component followed the WAI-ARIA patterns to meet the accessibility. The following ARIA attributes are used in the Range Slider component:
Attributes | Purpose |
---|---|
role=slider |
Used to convey a significant and contextual message to the user. |
aria-valuemin |
Indicates the Minimum value of the slider. |
aria-valuemax |
Indicates the Maximum value of the slider. |
aria-valuenow |
Indicates the current value of the slider. |
aria-valuetext |
Returns the current text of the slider. |
aria-orientation |
Indicates whether the Slider is oriented horizontally or vertically. |
aria-label |
Provides an accessible name for the Slider, serving as label text for the Slider’s left and right buttons (for increment and decrement). |
Keyboard interaction
The Range Slider component followed the keyboard interaction guideline, making it easy for people who use assistive technologies (AT) and those who completely rely on keyboard navigation. The following keyboard shortcuts are supported by the Range Slider component.
Press | To do this |
---|---|
Right Arrow/Up Arrow | Increase the Slider value. |
Left Arrow/Down Arrow | Decrease the Slider value. |
Home | Moves to the start value (for Range Slider when the second thumb is focused and the Home key is pressed, it moves to the first thumb value). |
End | Moves to the end value (for Range Slider when the first thumb is focused and the End key is pressed, it moves to the second thumb value). |
Page Up | Increases the Slider by largeStep value. |
Page Down | Decreases the Slider by largeStep value. |
Ensuring accessibility
The Range Slider component’s accessibility levels are ensured through an accessibility-checker and axe-core software tools during automated testing.
The accessibility compliance of the Range Slider component is shown in the following sample. Open the sample in a new window to evaluate the accessibility of the Range Slider component with accessibility tools.