Slider

Last updated Feb 13, 2026

Sliders let users choose a value (or range of values) along a continuous scale. They are useful for quick, approximate adjustments where visual feedback matters more than exact precision.

Anatomy of a slider
  1. Min/Max labels (optional): optional labels indicating the scale’s endpoints (e.g., 0 and 100).
  2. Fill : the portion of the track between the minimum and the current value.
  3. Thumb : the draggable handle used to set the value; shows focus and drag states.
  4. Track : the horizontal rail the thumb moves along.
  5. Value label / tooltip (optional): optional live value shown near the thumb on focus/drag.
PropTypeRequiredDefaultDescription
minnumber | undefinedfalse--
minLabelReactNodefalse--
maxnumber | undefinedfalse--
maxLabelReactNodefalse--
onChange((value: T) => void) | undefinedfalse--
valueT | undefinedfalse--
defaultValueT | undefinedfalse--
stepnumber | undefinedfalse--
showLabelsboolean | undefinedfalse-Show labels on ends of track
trackboolean | undefinedfalse-Track style
hideTooltipsboolean | undefinedfalse-Hide tooltips on slider thumbs
widthnumber | "auto" | undefinedfalse--
disabledboolean | undefinedfalse--
formatOptionsanyfalse--
idstring | undefinedfalse--
classNamestring | undefinedfalse--
namestring | undefinedfalse--
onBlurFocusEventHandler<HTMLDivElement> | undefinedfalse--
'aria-label'string | undefinedfalse--
'aria-labelledby'string | undefinedfalse--
  • Adjusting a value along a continuous scale (e.g., volume, opacity, zoom).
  • Choosing among many ordered values where exact precision is not critical.
  • Providing instant visual feedback as the user drags (e.g., previewing changes).
  • Use input when users must enter an exact value.
  • Use Select or Radio Buttons for a small set of discrete choices.
  • Use Progress Bar for read-only status, not input.

Do

  • Provide a clear label and, when helpful, min/max context (units, bounds).
  • Set an appropriate step (e.g., multiples of 1, 5, or 10) and a sensible default.
  • Use a value label on focus/drag when precision matters.
  • Keep the scale intuitive (low → high left to right).

Don't

  • Use a slider for precise inputs like currency or IDs.
  • Hide the current value when users need accuracy.
  • Pack multiple sliders with overlapping meanings into a tight space.
  • Use semantic roles/attributes:
    • role="slider" with aria-valuemin, aria-valuemax, aria-valuenow, and (when helpful) aria-valuetext.
    • Add aria-orientation="horizontal" (or vertical if used).
  • Provide keyboard navigation support.
  • For range sliders, expose two thumbs, each with its own focus and accessible name (e.g., “Minimum price”, “Maximum price”).
  • Announce value changes to assistive tech; pair with FormField so labels and helper/error text are programmatically associated.
  • Label the control clearly (e.g., “Opacity”). If units matter, show them (e.g., “Opacity (%)”).
  • Use concise helper text to explain the effect or valid range.
  • Prefer numeric ranges that match user expectations (e.g., 0-100).
  • If showing a value label/tooltip, format values consistently (e.g., 34%, $120).
  • Error text should clearly describe how the user can fix the problem (for example, “Choose a value between 10 and 50”).