stunning screenshots in seconds https://moocup.jaydip.me
at from-github 26 lines 1.1 kB view raw
1import * as React from "react" 2import * as SliderPrimitive from "@radix-ui/react-slider" 3 4import { cn } from "@/lib/utils" 5 6const Slider = React.forwardRef< 7 React.ElementRef<typeof SliderPrimitive.Root>, 8 React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> 9>(({ className, ...props }, ref) => ( 10 <SliderPrimitive.Root 11 ref={ref} 12 className={cn( 13 "relative flex w-full touch-none select-none items-center", 14 className 15 )} 16 {...props} 17 > 18 <SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary"> 19 <SliderPrimitive.Range className="absolute h-full bg-primary" /> 20 </SliderPrimitive.Track> 21 <SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-secondary transition-[color,box-shadow] focus-visible:outline-hidden hover:ring-4 ring-primary/40 focus-visible:ring-4 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" /> 22 </SliderPrimitive.Root> 23)) 24Slider.displayName = SliderPrimitive.Root.displayName 25 26export { Slider }