For AI agents: the complete documentation index is available at https://wallarm.github.io/design-system/llms.txt, the full documentation bundle is available at https://wallarm.github.io/design-system/llms-full.txt, and this page is available as Markdown at https://wallarm.github.io/design-system/components/slider.md.

Slider

Sets an approximate, bounded value by dragging along a track — reach for NumberInput when the exact figure matters, since a slider is faster to move than it is to land. A slider should always show its value: pair it with SliderInput for entry, or SliderValue for a readout. It implies a continuum, so a few fixed choices belong in SegmentedControl, Radio or Select, and on/off in Switch.

Source · Storybook

Usage

import { Slider, SliderControl, SliderThumb } from '@wallarm-org/design-system/Slider';

Examples

Range

Two entries in the value make two thumbs; render one SliderThumb per entry. The thumbs cannot cross, so the pair always reads as a valid range.

Ticks

SliderMarks draws ticks along the scale. Keep step aligned to the marks, or the handle lands between them and the ticks stop meaning anything.

Ticks without snapping

The same marks used purely for orientation, with step finer than their spacing. Choose this when the marks are a guide rather than the only valid answers.

Labeled

Marks carrying text, for a scale whose steps are named rather than numeric. The handle snaps to the labelled positions and announces the label rather than the number, so keep it to a handful of rungs.

With tooltip

tooltip on a SliderThumb shows the value while dragging, then hides it. It suits a value only checked mid-gesture; anything needed afterwards wants a persistent readout instead, never both.

With input

SliderInput is the precision escape hatch: the track for approximate moves, the field for an exact figure. Typing commits on blur or Enter rather than live, so clamping never fights a half-typed number.

Range with input

A field at each end, low on the left and high on the right. Neither crosses the other, so the fields cannot produce a range the track could not.

Disabled

The whole control dims and stops responding, handle included. The value stays legible, because a locked setting is usually one the reader still needs to read.

In field

Wrapped in Field, which is the form-field shape. The slider reads that context, so the label and error attach without being passed anything.

Field with error

invalid on the Field cascades to the handle. The message is FieldError's job, and it matters here because a slider cannot show a wrong value the way a text field can.

Field with value

The value beside the label, which is the readout Figma draws for a slider in a form — value beside label is the drawn default, not one option among several.

Range field with value

Both ends beside the label, comma-separated. For a range this is the only way to read the value without hovering each thumb.

With value readout

SliderValue reads the slider's own context, so a live readout needs no controlled state of its own.

Props

PropTypeDefaultDescription
errorboolean | undefinedfalseError state → maps to Ark invalid (repaints the handle; the message is the Field's job).
onValueChange((value: number[]) => void) | undefinedFires live during drag with the current value array ([n] single, [low, high] range).
onValueChangeEnd((value: number[]) => void) | undefinedFires once on drag release with the committed value array.
formstring | undefinedThe associate form of the underlying input element.
defaultValuenumber[] | undefined[50]The initial value of the slider when rendered. Use when you don't need to control the value of the slider.
disabledboolean | undefinedWhether the slider is disabled
namestring | undefinedThe name associated with each slider thumb (when used in a form)
valuenumber[] | undefinedThe controlled value of the slider
readOnlyboolean | undefinedWhether the slider is read-only
stepnumber | undefinedThe step value of the slider
maxnumber | undefinedThe maximum value of the slider
minnumber | undefinedThe minimum value of the slider
getAriaValueText((details: ValueTextDetails) => string) | undefinedFunction that returns a human readable value for the slider thumb
minStepsBetweenThumbsnumber | undefinedThe minimum permitted steps between multiple thumbs. minStepsBetweenThumbs * step should reflect the gap between the thumbs. - step: 1 and minStepsBetweenThumbs: 10 => gap is 10 - step: 10 and minStepsBetweenThumbs: 2 => gap is 20
thumbCollisionBehavior"none" | "push" | "swap" | undefinedControls how thumbs behave when they collide during pointer interactions. - none (default): Thumbs cannot move past each other; excess movement is ignored. - push: Thumbs push each other without restoring their previous positions when dragged back. - swap: Thumbs swap places when dragged past each other.
data-testidstring | undefined

SliderInput

PropTypeDefaultDescription
indexnumber | undefined0Which thumb this box is bound to (0 = single/low, 1 = high).
titlestring | undefined
patternstring | undefined
defaultCheckedboolean | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, HTMLInputElement> | undefined
typeHTMLInputTypeAttribute | undefined
disabledboolean | undefined
namestring | undefined
altstring | undefined
heightstring | number | undefined
srcstring | undefined
widthstring | number | undefined
autoCompleteHTMLInputAutoCompleteAttribute | undefined
maxLengthnumber | undefined
minLengthnumber | undefined
placeholderstring | undefined
readOnlyboolean | undefined
requiredboolean | undefined
checkedboolean | undefined
stepstring | number | undefined
acceptstring | undefined
maxstring | number | undefined
minstring | number | undefined
multipleboolean | undefined

SliderMarks

PropTypeDefaultDescription
marks *SliderMark[]Each entry places a tick at value; an optional label renders below it (and drives aria-valuetext for ordinal scales). Align step to the marks so drag and arrow-keys snap onto them.

SliderThumb

PropTypeDefaultDescription
indexnumber | undefined0Which thumb this is (0 = single/low, 1 = high).
tooltipboolean | undefinedfalseShow an on-drag value bubble above this thumb (DS Tooltip, opened by drag).
titlestring | undefined
defaultCheckedboolean | undefined
defaultValuestring | number | readonly string[] | undefined
autoFocusboolean | undefined
idstring | undefined
tabIndexnumber | undefined
relstring | undefined
onChangeChangeEventHandler<T, Element> | undefined
namestring | undefined

SliderValue

PropTypeDefaultDescription
indexnumber | undefinedShow one thumb's value (range). Omit to show all (single → "50", range → "20 – 80").