web/plugins/RangeSlider/page.jsx

35 lines
767 B
React
Raw Normal View History

2024-01-10 11:04:28 +03:30
import Slider from "rc-slider";
2024-02-16 19:36:30 +03:30
import "rc-slider/assets/index.css";
2024-01-10 11:04:28 +03:30
2024-04-25 22:36:36 +03:30
const RangeSlider = ({ min, max, onChange, values }) => {
2024-02-27 21:23:20 +03:30
const handleStyleMin = {
2024-01-10 11:04:28 +03:30
borderColor: "#2189A8",
height: 25,
width: 25,
marginTop: -9,
backgroundColor: "white",
2024-02-27 21:23:20 +03:30
// left: 0,
2024-01-10 11:04:28 +03:30
};
const trackStyle = [{ backgroundColor: "#2189A8", height: 8 }];
const railStyle = { backgroundColor: "#e6e6e6", height: 8 };
return (
<Slider
range
min={min}
max={max}
allowCross={false}
2024-04-25 22:36:36 +03:30
value={values ?? [min, max]}
2024-02-27 21:23:20 +03:30
// defaultValue={[min, max]}
2024-04-25 22:36:36 +03:30
onChangeComplete={onChange}
2024-02-27 21:23:20 +03:30
handleStyle={[handleStyleMin, handleStyleMin]}
2024-01-10 11:04:28 +03:30
trackStyle={trackStyle}
railStyle={railStyle}
/>
);
};
export default RangeSlider;