MCPcopy Index your code
hub / github.com/adobe/react-spectrum / Slider

Function Slider

starters/tailwind/src/Slider.tsx:65–99  ·  view source on GitHub ↗
({
  label,
  thumbLabels,
  fillOffset,
  ...props
}: SliderProps<T>)

Source from the content-addressed store, hash-verified

63}
64
65export function Slider<T extends number | number[]>({
66 label,
67 thumbLabels,
68 fillOffset,
69 ...props
70}: SliderProps<T>) {
71 return (
72 <AriaSlider
73 {...props}
74 className={composeTailwindRenderProps(
75 props.className,
76 'font-sans orientation-horizontal:grid orientation-vertical:flex grid-cols-[1fr_auto] flex-col items-center gap-2 orientation-horizontal:w-64 orientation-horizontal:max-w-[calc(100%-10px)]'
77 )}>
78 <Label>{label}</Label>
79 <SliderOutput className="text-sm text-neutral-500 dark:text-neutral-400 orientation-vertical:hidden" />
80 <SliderTrack className="group col-span-2 orientation-horizontal:h-5 orientation-vertical:w-5 orientation-vertical:h-38 flex items-center">
81 {({state, ...renderProps}) => (
82 <>
83 <div className={trackStyles(renderProps)}>
84 <SliderFill offset={fillOffset} className={fillStyles(renderProps)} />
85 </div>
86 {state.values.map((_, i) => (
87 <SliderThumb
88 key={i}
89 index={i}
90 aria-label={thumbLabels?.[i]}
91 className={thumbStyles}
92 />
93 ))}
94 </>
95 )}
96 </SliderTrack>
97 </AriaSlider>
98 );
99}

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected