2024-02-21 21:07:32 +01:00
|
|
|
import * as React from "react";
|
|
|
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
2023-12-08 14:33:22 +01:00
|
|
|
|
2024-02-21 21:07:32 +01:00
|
|
|
import { cn } from "@/lib/utils";
|
2023-12-08 14:33:22 +01:00
|
|
|
|
|
|
|
const Slider = React.forwardRef<
|
|
|
|
React.ElementRef<typeof SliderPrimitive.Root>,
|
|
|
|
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
|
|
|
|
>(({ className, ...props }, ref) => (
|
|
|
|
<SliderPrimitive.Root
|
|
|
|
ref={ref}
|
|
|
|
className={cn(
|
|
|
|
"relative flex w-full touch-none select-none items-center",
|
|
|
|
className
|
|
|
|
)}
|
|
|
|
{...props}
|
|
|
|
>
|
2024-02-21 21:07:32 +01:00
|
|
|
<SliderPrimitive.Track className="relative h-1 w-full grow overflow-hidden rounded-full">
|
|
|
|
<SliderPrimitive.Range className="absolute h-full bg-blue-500" />
|
2023-12-08 14:33:22 +01:00
|
|
|
</SliderPrimitive.Track>
|
|
|
|
</SliderPrimitive.Root>
|
2024-02-21 21:07:32 +01:00
|
|
|
));
|
|
|
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
2023-12-08 14:33:22 +01:00
|
|
|
|
2024-02-21 21:07:32 +01:00
|
|
|
export { Slider };
|