Skip to content
← UI patterns

Slider

Drag a thumb along a track to pick a value from a range, for settings where roughly right beats exactly typed.

62

Native input, fully keyboard operable. Value shown above, never below.

Continuous: a native range input with a live readout above the track. Best when an approximate value with real-time feedback is enough.
SizeM
XSSMLXL

Discrete role=slider. Arrows step; Home/End jump. Announced as “M” via aria-valuetext.

Discrete: a stepped role=slider that snaps to labeled stops and announces each as text (aria-valuetext), not a bare number.
Price$120 – $360

Two thumbs, each role=slider; the lower is capped by the upper, so they never cross.

Range: two thumbs set the ends of a price band. The lower thumb is capped by the upper, so the handles can never cross.
%

Drag for a rough value; type the field when the exact number matters.

Slider plus input: the slider gives a quick approximation and the number field captures the exact value, the pattern for when precision matters.

Behavior

Keyboard

Right / Up Arrow
Increases the value by one step.
Left / Down Arrow
Decreases the value by one step.
Home / End
Sets the slider to its minimum (Home) or maximum (End) allowed value.
Page Up / Page Down
Increases or decreases the value by a larger amount than the arrow keys (optional but recommended for long ranges).
Parts

Track / rail

The bar the thumb travels along, representing the full range from minimum to maximum. Its length maps the range to screen space, so a wider track gives finer control and a denser range makes precise selection harder.

Thumb / handle

The draggable control that sets the value. It is the focusable element carrying role=slider, aria-valuenow, aria-valuemin, aria-valuemax, and an accessible name, and it must be a large enough pointer target to grab reliably.

Fill / progress

The portion of the track between the minimum and the current thumb position, usually colored, that shows at a glance how far along the range the value sits.

Value readout

The current value shown beside or above the slider (never below, where a thumb obscures it). Because the slider does not surface its value on its own and is imprecise, the readout is what makes the chosen value legible.

Ticks and labels (discrete)

Optional marks and labels at allowed stops on a stepped slider, set by the step granularity. They show the permitted values and help the thumb land on one, and for non-numeric stops they pair with aria-valuetext.

Second thumb (range)

On a range slider, a second thumb sets the other end. The two thumbs cannot cross: the lower thumb's maximum is capped by the upper thumb's current value, and vice versa, while their tab order stays constant.

States

Drag, click, and step

The value changes by dragging the thumb, and often by clicking a point on the track or pressing arrow keys to step. Steering to a precise point is hard and gets harder as the range widens or densifies, which is why sliders suit approximate values and benefit from real-time feedback.

Continuous versus discrete

A continuous slider moves smoothly across the range; a discrete slider snaps to allowed stops defined by the step granularity, often drawn with ticks. Discrete steps make values easier to hit and to label, including non-numeric labels via aria-valuetext.

Range thumbs cannot cross

On a two-thumb range slider the thumbs constrain each other: the lower thumb cannot move past the upper, and the upper cannot move below the lower. The tab order between them stays constant even if their values would visually swap.

Touch and precision

On touch, users often nudge the thumb off the intended value as they lift their finger, and precise placement is daunting for users with motor difficulties or less steady hands. Generous thumb targets and a way to fine-tune (steppers or a paired input) mitigate this.

Orientation

Sliders are horizontal by default but can be vertical, for example a level or volume fader. A vertical slider sets aria-orientation=vertical so its orientation is conveyed; the arrow-key directions follow accordingly.

References

W3C APG temperature slider example showing a vertical track with a thumb and a current value of 25.0 degrees Celsius.
APG Slider PatternW3C WAI ARIA APG
W3C APG multi-thumb slider example showing a single track with two thumbs setting a minimum and maximum value.
APG Multi-Thumb Slider PatternW3C WAI ARIA APG

Use it

Figma
A continuous slider with a live value
  1. Draw the track as a thin rounded rectangle; overlay a fill rectangle pinned to the left that represents the value.
  2. Place a circular thumb, constrained vertically centered, at the right edge of the fill.
  3. Add a value label above the thumb (never below) and expose the fill and thumb colors as variables for theming.
  4. Make a component and use a number variable or several variants to show low, middle, and high positions.

Group the fill and thumb so moving the value means dragging one element; keep the value label anchored above so a finger never hides it.

A discrete slider with ticks
  1. Lay tick marks along the track at even intervals using an Auto Layout row with space-between distribution.
  2. Label the meaningful stops (for example S, M, L) beneath or above the ticks.
  3. Build variants for each stop so the thumb and fill land exactly on a tick in every state.
  4. Annotate that each stop maps to a step value and that non-numeric labels need aria-valuetext in the build.

Distribute ticks with Auto Layout rather than placing them by hand, so they stay even if the track width changes.

A two-thumb range slider
  1. Start from the continuous slider and add a second thumb; make the fill the segment between the two thumbs.
  2. Create variants showing a narrow and a wide range so the fill clearly spans only the selected interval.
  3. Show both value labels, one per thumb, above the track.
  4. Annotate that the thumbs cannot cross and that each is its own role=slider with bounds capped by the other in the build.

Pin the fill between the two thumb positions so resizing the range updates the colored segment, not the whole track.

Slider paired with a number input
  1. Place a number field beside the slider in a horizontal Auto Layout frame.
  2. Show the same value in both, so the field reads as the precise mirror of the thumb.
  3. Add focus states to both controls and a note that editing either updates the other in the build.
  4. Caption the pair as the pattern for when exact values matter, not the slider alone.

Right-size the number field to the value's digits so it does not dominate the slider it supports.

Accessibility

Each thumb is a role=slider with aria-valuenow inside aria-valuemin and aria-valuemax, an accessible name, and a full keyboard contract: arrows step, Home and End go to the extremes, Page keys jump. Add aria-valuetext whenever the number alone would not be understandable, set aria-orientation for vertical sliders, make the thumb a large enough target, and always show the value visibly.

  1. Make the slider fully keyboard operable; never ship a drag-only control.
  2. Show the current value beside or above the slider, not below where a thumb hides it, since the value is not exposed by default.
  3. Where the exact value matters, pair the slider with a number input or steppers instead of relying on drag precision.
  4. Give the thumb a pointer target of at least 24 by 24 CSS pixels to meet WCAG 2.2 SC 2.5.8 and to be grabbable on touch.
  5. Do not encode the value in track color alone; the readout and labels must carry it for color-blind and low-vision users.
Research notes & sources

role=slider per thumb with aria-valuemin / aria-valuemax / aria-valuenow (and aria-valuetext when the number is not self-explanatory); arrow keys, Home, End, Page Up/Down

  1. Slider Pattern (ARIA Authoring Practices Guide)W3C WAI
  2. Slider (Multi-Thumb) Pattern (ARIA Authoring Practices Guide)W3C WAI
  3. <input type="range">MDN Web Docs
  4. Slider Design: Rules of ThumbNielsen Norman Group
  5. Understanding SC 2.5.8: Target Size (Minimum) (Level AA)W3C WAI (WCAG 2.2)