Examples

Price range

Each thumb has its own accessible name.

Preview
$200 – $800
Example.tsx
import { RangeSlider } from '@reactloom/ui';

export default function Example() {
  return (
    <div style={{ width: '100%', maxWidth: 360 }}>
      <RangeSlider
        label="Price"
        name="price"
        defaultValue={[200, 800]}
        maxValue={1000}
        step={10}
        formatOptions={{ style: 'currency', currency: 'USD', maximumFractionDigits: 0 }}
        thumbLabels={['Minimum price', 'Maximum price']}
      />
    </div>
  );
}

Right-to-left

Arabic locale: digits, layout and arrow keys are mirrored.

Preview
٢٠ – ٧٠
Example.tsx
import { LocaleProvider, RangeSlider } from '@reactloom/ui';

export default function Example() {
  return (
    // The locale mirrors keyboard behaviour; dir mirrors the layout. Set both.
    <LocaleProvider locale="ar-EG">
      <div dir="rtl" lang="ar" style={{ width: '100%', maxWidth: 360 }}>
        <RangeSlider label="السعر" defaultValue={[20, 70]} thumbLabels={['الحد الأدنى', 'الحد الأقصى']} />
      </div>
    </LocaleProvider>
  );
}

API reference

RangeSlider props
PropTypeDefault
value / defaultValue
[number, number]—
onValueChange · onValueCommit
(value: [number, number]) => void—
thumbLabels
Accessible names of the thumbs — translate these.
[string, string]['Minimum', 'Maximum']
label · minValue · maxValue · step · formatOptions · showValue · name · disabled · size
As Slider.
—

Accessibility

  • Two native range inputs inside a labelled group; each thumb is named by thumbLabels.
  • A thumb stops at the other thumb’s value, so the range can never invert.
Keyboard interactions
KeyAction
TabMove between thumbs
← / → · ↑ / ↓Move the focused thumb
Home / EndThumb’s minimum / maximum

Usage guidelines

Do

  • Name the thumbs for the domain (“Minimum price”).

Don’t

  • Don’t use for more than two values.