cal.pub0.org/components/Slider.tsx

21 lines
578 B
TypeScript
Raw Normal View History

import * as SliderPrimitive from "@radix-ui/react-slider";
import React from "react";
2021-08-13 07:59:48 +00:00
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}
value={[value]}
2021-08-13 07:59:48 +00:00
aria-label={label}
onValueChange={changeHandler}>
<SliderPrimitive.Track className="slider-track">
<SliderPrimitive.Range className="slider-range" />
</SliderPrimitive.Track>
<SliderPrimitive.Thumb className="slider-thumb" />
2021-08-13 07:59:48 +00:00
</SliderPrimitive.Root>
);
export default Slider;