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

Function useStepList

packages/react-aria/src/steplist/useStepList.ts:28–53  ·  view source on GitHub ↗
(
  props: AriaStepListProps<T>,
  state: StepListState<T>,
  ref: RefObject<HTMLOListElement | null>
)

Source from the content-addressed store, hash-verified

26}
27
28export function useStepList<T>(
29 props: AriaStepListProps<T>,
30 state: StepListState<T>,
31 ref: RefObject<HTMLOListElement | null>
32): StepListAria {
33 let {'aria-label': ariaLabel} = props;
34 let {listProps} = useSelectableList({
35 ...props,
36 ...state,
37 allowsTabNavigation: true,
38 ref
39 });
40
41 const strings = useLocalizedStringFormatter(intlMessages, '@react-aria/steplist');
42 const stepListProps: HTMLAttributes<HTMLElement> = {
43 ...mergeProps(listProps, filterDOMProps(props, {labelable: true})),
44 'aria-label': ariaLabel || strings.format('steplist')
45 };
46
47 return {
48 listProps: {
49 ...stepListProps,
50 tabIndex: undefined
51 }
52 };
53}

Callers 1

StepList.tsxFile · 0.90

Calls 5

useSelectableListFunction · 0.90
mergePropsFunction · 0.90
filterDOMPropsFunction · 0.90
formatMethod · 0.45

Tested by

no test coverage detected