Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Range Slider
  3. Usage

Range Slider

Usage

RangeSlider selects a start and an end on one track with two thumbs. Use it for filters where both bounds are meaningful: a price band, a QA score window, a time slice, a search radius range.
When to use
  • A min/max filter where "about here" is enough and the bounds are bounded by min and max.
When not to use
  • Exact thresholds: use two NumberFields with validation.
  • One value: use Slider.
Basics
Name the group and both thumbs. The group needs a visible label, aria-label or aria-labelledby; the thumbs need startLabel and endLabel.
  • value, defaultValue and onValueChange use a [start, end] tuple. An uncontrolled range starts at [min, max].
  • The thumbs never cross. minStepsBetweenThumbs keeps them apart by that many steps.
  • A controlled value that is out of range or reversed paints as the nearest valid range and is never reported as a change.
  • min, max, step, orientation, disabled, name and form behave as they do on Slider. name submits the start and then the end (FormData.getAll(name)), and a form reset restores defaultValue.
  • orientation uses SliderOrientation from the Slider entry point.
Header, value text and marks
label, showValue, formatValue, locale and ticks work as they do on Slider. The header's readout shows both ends, start then end, joined with an en dash (20; 80); each thumb's aria-valuetext is its own formatted value, and each thumb has its own value bubble while you drag it or step it with the keyboard. The bubble rolls its digits with the default format and shows formatValue text as plain text.
Motion matches Slider: spring for clicks and keys, none while dragging, a stretch past an end, a coast after a fast release and a bump at a limit, all off under reduced motion. A thumb held back by its neighbor does not stretch toward it. ui-core's showInput is not part of RangeSlider (contract RS-5; Chris approved with Slider SL-4). Compose two NumberFields beside the track and keep min, max, step and the tuple in sync; see the Slider usage doc for a single-value composition example.
Layout
The slider fills the width of its container. Its track is 6px and its thumbs are 20px, which sets the height of the control; a header row sits above it with a label or showValue, and marks sit below it with ticks. Pointer presses register in a 24px band across the track (44px on coarse pointers); a press on the track moves the nearest thumb.
Previous
Radio Cards / Accessibility
Next
Range Slider / API and Development
On this page
When to use
When not to use
Basics
Header, value text and marks
Layout