Use this component like a range input with dynamic steps. Fully responsive and supports touch.
$ npm install react-step-range-slider --save
Usage:
import StepRangeSlider from 'react-step-range-slider'
const range = [
{ value: 0, step: 1 }, // acts as min value
{ value: 20, step: 5 },
{ value: 50, step: 10 },
{ value: 100, step: 50 },
{ value: 500 } // acts as max value
]
<StepRangeSlider
value={5}
range={range}
onChange={value => console.log(value)}
/>
Configures min and max values as well as the step for each value breakpoint. Required.
Determines the position of the drag handle. Should be divisible by the step at the appropriate value breakpoint.
Determines initial position of the drag handle.
Callback called on value change.
Callback called on drag end or on click.
Prevent value change.
Provide your own class for the outer element.
Display whatever you want in the drag tooltip. Defaults to a tooltip.
Decrements the step of the slider by the specified number.
Increments the step of the slider by the specified number.