// Props to https://github.com/shadcn-ui/ui/issues/885#issuecomment-2059600641 // @mildtomato - consider using this as the main Slider component in packages/ui import { Slider as SliderPrimitive } from 'radix-ui' import { ComponentPropsWithoutRef, ElementRef, forwardRef, Fragment } from 'react' import { cn } from 'ui' export const Slider = forwardRef< ElementRef, ComponentPropsWithoutRef >(({ className, ...props }, ref) => { const initialValue = Array.isArray(props.value) ? props.value : [props.min, props.max] return ( {initialValue.map((_, index) => ( ))} ) }) Slider.displayName = SliderPrimitive.Root.displayName