cal.pub0.org/components/Slider.tsx

23 lines
604 B
TypeScript
Raw Normal View History

2021-08-13 07:59:48 +00:00
import React from 'react';
import * as SliderPrimitive from '@radix-ui/react-slider';
const Slider = ({value, min, max, step, label, changeHandler}) => (
<SliderPrimitive.Root
2021-08-13 13:07:26 +00:00
className="slider mt-2"
min={min}
2021-08-13 09:34:20 +00:00
step={step}
2021-08-13 07:59:48 +00:00
max={max}
2021-08-13 09:34:20 +00:00
value={[value]}
2021-08-13 07:59:48 +00:00
aria-label={label}
2021-08-13 09:34:20 +00:00
onValueChange={changeHandler}
2021-08-13 07:59:48 +00:00
>
<SliderPrimitive.Track className="slider-track">
<SliderPrimitive.Range className="slider-range" />
</SliderPrimitive.Track>
<SliderPrimitive.Thumb className="slider-thumb" />
</SliderPrimitive.Root>
);
export default Slider;