InputRange
Slider for selecting a numeric value on a continuous range between min and
max. Supports labeled marks, a colored gradient, and a disabled state.
When to use
| ✅ Use when… | 🚫 Avoid when… |
|---|---|
|
|
Variations
Default
50
<InputRange min={0} max={200} value={50} onChange={setValue} />With marks (mark + markLabel)
Step 0
Step 20
Step 40
Step 60
Step 80
Step 100
Step 60
<InputRange mark markLabel step={20} getLabelValue={(n) => `Step ${n}`} />Gradient (qualitative scale)
0 ℃
20 ℃
40 ℃
60 ℃
80 ℃
100 ℃
60 ℃
<InputRange gradient mark markLabel step={20} getLabelValue={(n) => `${n} ℃`} />Disabled
Properties
Prop | Type | Default | Description |
|---|---|---|---|
disabled | boolean | — | — |
getLabelValue | ((n: number) => string) | — | — |
gradient | boolean | — | — |
mark | boolean | — | — |
markLabel | boolean | — | — |
max | number | 100 | — |
min | number | 0 | — |
onChange | ((v: number) => void) | — | — |
step | number | 1 | — |
value | number | 50 | — |
In addition to the props above, every component accepts the layout props (spacing, color, flex/grid, sizing, border) — not repeated here.
See also
- Storybook story: Components / InputRange