cal.pub0.org/components/Slider.tsx

25 lines
714 B
TypeScript
Raw Normal View History

2021-08-13 07:59:48 +00:00
import React from 'react';
// import { styled } from '@stitches/react';
// import { violet, blackA } from '@radix-ui/colors';
import * as SliderPrimitive from '@radix-ui/react-slider';
const Slider = ({value, min, max, step, label, changeHandler}) => (
<SliderPrimitive.Root
className="slider"
2021-08-13 09:34:20 +00:00
// defaultValue={[value]}
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;