MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Thumb

Function Thumb

starters/hooks/src/Slider.tsx:99–123  ·  view source on GitHub ↗
({
  state,
  trackRef,
  index,
  ...props
}: Omit<AriaSliderThumbOptions, 'inputRef'> & {state: SliderState})

Source from the content-addressed store, hash-verified

97}
98
99function Thumb({
100 state,
101 trackRef,
102 index,
103 ...props
104}: Omit<AriaSliderThumbOptions, 'inputRef'> & {state: SliderState}) {
105 let inputRef = useRef<HTMLInputElement>(null);
106 let {thumbProps, inputProps, isDragging} = useSliderThumb(
107 {...props, index, trackRef, inputRef},
108 state
109 );
110 let {focusProps, isFocusVisible} = useFocusRing();
111
112 return (
113 <div
114 {...thumbProps}
115 className="react-aria-SliderThumb indicator"
116 data-dragging={isDragging || undefined}
117 data-focus-visible={isFocusVisible || undefined}>
118 <VisuallyHidden>
119 <input ref={inputRef} {...mergeProps(inputProps, focusProps)} />
120 </VisuallyHidden>
121 </div>
122 );
123}

Callers

nothing calls this directly

Calls 3

useSliderThumbFunction · 0.90
useFocusRingFunction · 0.90
mergePropsFunction · 0.90

Tested by

no test coverage detected