Skip to content

RangeSlider

Two-thumb slider for picking a numeric range; built on React Aria's Slider.

  • stable
  • since v0.1.0
  • 1.1 kB
  • forms

Each thumb is role="slider" with aria-valuemin/max/now; arrow keys move thumbs by step.

Preview
Open
tsx

Three track sizes are available: sm, md (default), and lg.

Preview
Open
tsx

Set label for a visible caption and showValue to render the formatted range next to it.

Preview
Open
tsx

Use step to constrain motion to discrete increments.

Preview
Open
tsx

Pass formatOptions to render currency, percent, or unit-aware values.

Preview
Open
tsx
Preview
Open
tsx
PropTypeDefaultDescription
label
ReactNode
Visible label rendered above the track.
size
"sm"|"md"|"lg"
"md"
Track size.
showValue
boolean
Renders the current `[start, end]` pair beside the label.
formatOptions
NumberFormatOptions
Intl format options for locale-aware display. The display format of the value label.
className
string
style
CSSProperties
value
[number, number]
defaultValue
[number, number]
onChange
((value: [number, number]) => void)
  • Each thumb exposes role="slider" with aria-valuemin, aria-valuemax, and aria-valuenow.
  • Arrow Left/Right (or Up/Down) move the focused thumb by step; Page Up/Down move by a larger increment.
  • Home/End jump to the bounds; thumbs cannot cross each other.
  • When label is a string, both thumbs receive descriptive aria-labels ({label} (min) / {label} (max)).
  • Use for price ranges, numeric filters, or date windows where both ends matter.
  • Provide formatOptions for localized currency or percent rendering.
  • Combine with helper text below the slider to describe the unit when not implied by formatOptions.