Skip to content

Slider

The Slider component allows users to select one or multiple values from a defined range by dragging one or more handles (thumbs) along a track. It is commonly used for adjusting numeric values, setting limits, or selecting ranges in a visual and intuitive way.

Sliders can be configured to support:

  • A single handle (e.g. volume, brightness, zoom)
  • Multiple handles (e.g. selecting multiple thresholds)
  • Range selection (minimum and maximum values)

They provide immediate visual feedback and are ideal when users benefit from seeing relative positions within a range rather than entering precise numbers manually.

Use a slider when:

  • Users need to adjust a value within a known, limited range.
  • You want to provide a quick and interactive way to modify settings.
  • Visual comparison across a range adds clarity (e.g. price filters, time ranges).

Avoid sliders when:

  • Users must enter highly precise or arbitrary values.
  • The range is very large or undefined.
  • Accessibility or keyboard-only input is the primary interaction — consider pairing the slider with an input field.

Quick summary of accessibility & consistency

Section titled “Quick summary of accessibility & consistency”
  • Ensure the slider is fully operable via keyboard (arrow keys, Home/End).
  • Provide ARIA roles and attributes (e.g. role="slider", aria-valuemin, aria-valuemax, aria-valuenow).
  • Make sure labels are programmatically associated with the slider.
  • Maintain sufficient color contrast for the track, handles, and focus states.
  • Provide visible focus indicators for keyboard users.
  • Announce value changes appropriately for screen readers.
Slider
Direction: Horizontal
Gap:
spacing-2424px
 
spacing-2424px
 
Track
Height:
spacing-044px
 
spacing-044px
 
Width: 100%
Border radius:
radius-xl1000px
 
radius-xl1000px
 
Progress
Height:
spacing-044px
 
spacing-044px
 
Border radius:
radius-xl1000px
 
radius-xl1000px
 
Thumb
Size:
spacing-2424px
 
spacing-2424px
 
Border radius:
radius-xl1000px
 
radius-xl1000px
 
Border width: 1
Track
Background color:
color-fill-neutral-emphasis#4d4d4d
color-fill-neutral-emphasis#000000
Progress
Background color:
color-fill-neutral-emphasis#4d4d4d
color-fill-neutral-emphasis#000000
Thumb
Background color:
color-fill-neutral-emphasis#4d4d4d
color-fill-neutral-emphasis#000000
Dot color:
color-fill-contrast-emphasis#f5f5f5
color-fill-contrast-emphasis#ffffff
Border color:
color-border-contrast-default#e4e4e4
color-border-contrast-default#e4e4e4
Thumb
Background color:
color-fill-neutral-subtle#e5e3e1
color-fill-neutral-subtle#6c7073
Dot color:
color-fill-contrast-emphasis#f5f5f5
color-fill-contrast-emphasis#ffffff
Thumb
Background color:
color-fill-contrast-default#d4d2d1
color-fill-contrast-default#e4e4e4
Dot color:
color-fill-neutral-muted#f5f5f5
color-fill-neutral-muted#a8aaac
Track
Background color:
color-fill-contrast-default#d4d2d1
color-fill-contrast-default#e4e4e4
Progress
Background color:
color-fill-neutral-emphasis#4d4d4d
color-fill-neutral-emphasis#000000
Track
Background color:
color-border-ev-default#d49677
color-border-ev-default#0072f0
NameApplied asApplied to
color-fill-neutral-emphasis
Background colorTrack, Progress, Thumb
color-fill-neutral-emphasis
Background colorTrack, Progress, Thumb
color-fill-neutral-subtle
Background colorThumb (active)
color-fill-neutral-subtle
Background colorThumb (active)
color-fill-neutral-muted
Background colorThumb (disabled dot)
color-fill-neutral-muted
Background colorThumb (disabled dot)
color-fill-contrast-emphasis
Dot colorThumb
color-fill-contrast-emphasis
Dot colorThumb
color-fill-contrast-default
Background colorTrack (range), Thumb (disabled)
color-fill-contrast-default
Background colorTrack (range), Thumb (disabled)
color-border-contrast-default
Border colorThumb
color-border-contrast-default
Border colorThumb
color-border-ev-default
Background colorTrack (EV variant)
color-border-ev-default
Background colorTrack (EV variant)
NameApplied asApplied to
 
spacing-04
HeightTrack, Progress
 
spacing-04
HeightTrack, Progress
 
spacing-24
SizeThumb, Gap
 
spacing-24
SizeThumb, Gap
 
radius-xl
Border radiusTrack, Progress, Thumb
 
radius-xl
Border radiusTrack, Progress, Thumb
  • All states (rested, disabled) must maintain accessible contrast.
  • Focus styles must remain visible and meet WCAG AA contrast requirements across all supported surfaces.
  • Colour tokens used should be semantic (e.g. foreground/neutral/default) rather than fixed values to ensure the component adapts correctly to different themes or surfaces.

To ensure the slider meets WCAG 2.1 AA and supports assistive technologies, follow these implementation standards:

  1. Key Points
    • The slider must be operable without a mouse or touch.
    • Users must always be able to perceive the current value.
    • Changes in value should be clearly communicated to assistive technologies.
    • Interaction should be predictable and consistent.
    • Visual, motor, and cognitive accessibility needs should all be considered.
  2. Keyboard Navigation
    • The slider must be fully operable using the keyboard.
    • Each handle (thumb) must be individually focusable.
    • Recommended keyboard behavior:
      • Arrow keys: increase or decrease the value by one step.
      • Shift + Arrow keys (optional): increase or decrease by a larger step.
      • Home: move the handle to the minimum value.
      • End: move the handle to the maximum value.
    • For range or multi-handle sliders, keyboard interaction must clearly indicate which handle is currently active.
  3. Focus Ring / Visible Focus
    • Sliders must have a visible focus indicator when focused via keyboard.
    • Focus should move logically and predictably, especially when multiple handles are present.
    • When a value changes via keyboard interaction, focus must remain on the active handle.
    • Avoid moving focus automatically unless explicitly triggered by the user.
  4. Screen Reader Support
    • Each slider handle must expose the correct ARIA role and attributes, including:
      • role="slider"
      • aria-valuemin
      • aria-valuemax
      • aria-valuenow
      • aria-valuetext (when a formatted or non-numeric value is shown)
    • The slider must have a programmatically associated label that clearly describes its purpose.
    • Screen readers should announce the slider label, the current value, and the minimum and maximum values.
    • Value changes triggered by keyboard input should be announced in real time.
    • For range sliders, ensure that each handle is announced distinctly (e.g. “Minimum value” and “Maximum value”).
Guidance on how to use a component.
  • Provide clear labels for the slider and its values (min, max, current).
  • Use sensible defaults that reflect common or recommended values.
  • Show the current value near the handle or in a linked input.
  • Snap to steps when values should be discrete (e.g. 5, 10, 15).
  • Use range sliders when users need to define both minimum and maximum bounds.
Guidance on what to avoid when using a component.
  • Don’t use sliders for precise data entry (use input fields instead).
  • Don’t overload the slider with too many handles — it reduces clarity.
  • Don’t hide value feedback; users should always know what they’re selecting.
  • Don’t rely on color alone to communicate state or limits.
  • Don’t make sliders too small to interact with comfortably.