Forms
RangeSlider
Pick a minimum and maximum with two thumbs that cannot cross — for price ranges, time windows and filters.
import { RangeSlider } from '@reactloom/ui';Examples
Price range
Each thumb has its own accessible name.
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.
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
| Prop | Type | Default |
|---|---|---|
value / defaultValue | [number, number] | — |
onValueChange · onValueCommit | (value: [number, number]) => void | — |
thumbLabelsAccessible names of the thumbs — translate these. | [string, string] | ['Minimum', 'Maximum'] |
label · minValue · maxValue · step · formatOptions · showValue · name · disabled · sizeAs 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.
| Key | Action |
|---|---|
| Tab | Move between thumbs |
| ← / → · ↑ / ↓ | Move the focused thumb |
| Home / End | Thumb’s minimum / maximum |
Usage guidelines
Do
- Name the thumbs for the domain (“Minimum price”).
Don’t
- Don’t use for more than two values.