MultiRangeSlider is a React component that allows users to select a range of values using multiple sliders.
You can install MultiRangeSlider via npm:
npm install @abhilaksharora/multi-range-slider
import React, { useState } from 'react';
import MultiRangeSlider from '@abhilaksharora/multi-range-slider';
const App = () => {
const [range, setRange] = useState({ min: 0, max: 100 });
const handleRangeChange = (values) => {
setRange(values);
};
return (
<div>
<h1>Multi Range Slider Example</h1>
<MultiRangeSlider min={0} max={100} onChange={handleRangeChange} />
<p>Selected Range: {range.min} - {range.max}</p>
</div>
);
};
export default App;
-
min
(number, required): The minimum value of the slider. -
max
(number, required): The maximum value of the slider. -
onChange
(function, required): A callback function called whenever the selected range changes. It receives an object containing themin
andmax
values of the range.
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.