Slider

v 1.3.0

Overview

Slider provides a mechanism for selecting/displaying a value (one handler) or a range of values (two handlers). It is very clear and easy to use especially on mobile (touch) devices.

Usage

  • Sliders are an ideal way to change a value when the results will be seen immediately (e.g. setting volume, adjusting zoom). Conversely, sliders should not be used to adjust a value when the result is not immediately apparent.
  • Sliders are not the optimal choice when each position on the scale has a long and unique name.
  • Sliders are best applied when the scale is linear and the values can be expressed minimally.
  • The basic slider with no scale can be combined with a dynamic label that specifies exactly where the slider is set. This results in a very minimal and clean appearance while accurately displaying the current value.

Anatomy

Visual Style

Spacing, Dimensions

Basic- Horizontal Orientation

Label- Optional

Tick Mark- Optional

• Tick marks are evenly spaced along the slider track, and the handle will snap to them.


• Each tick mark should change the setting in increments that are discernable to the user.

w/Tick Mark Value Types- Optional

w/Two Handles for a Range- Optional

Special Notes for Handle and Value Track

  • By clicking and dragging the track value region, both of the handles will also be dragged along the track together maintaining the range that was set.


Text Wrapping

Standard Appearance

The Label and Value are located on the LEFT of the slider bar.

Text Wrapping


Labels and Values with high character count will wrap to multiple lines. Label and Value will stack when very minimal width is available.

Sample


Behavior


States


Digital Accessibility

Keyboard Behavior

KeyFunction
Right ArrowIncreases slider value one step.
Up ArrowIncreases slider value one step.
Left ArrowDecreases slider value one step.
Down ArrowDecreases slider value one step.
Page Up / HomeIncrease slider value by 50% of the active node value
Page Down / EndDecreases slider value by 50% of the active node value

Screen Reader

Semantic HTML RoleAnnounced Content (Defined by app-side)ARIA Attribute
SLIDERIdentifies the focusable element as SLIDER
ARIA-VALUENOWThe current value
ARIA-VALUEMINThe minimum value allowed
ARIA-VALUEMAXThe maximum value allowed
ARIA-LABELLEDBYThe visible label for the Slider

References

See code on Storybook