alpha

useStepListState

installyarn add @react-stately/steplist
version3.0.0-alpha.10
usageimport {useStepListState} from '@react-stately/steplist'

API#


useStepListState<T extends object>( (props: StepListProps<T> )): StepListState<T>

Interface#


Properties

NameTypeDescription
selectedKeyKeynullThe key for the currently selected item.
selectedItemNode<T>nullThe value of the currently selected item.
collectionCollection<Node<T>>A collection of items in the list.
disabledKeysSet<Key>A set of items that are disabled.
selectionManagerSelectionManagerA selection manager to read and update multiple selection state.
lastCompletedStepKey

Methods

MethodDescription
setLastCompletedStep( (key: Key )): void
isCompleted( (key: Key )): boolean
isSelectable( (key: Key )): boolean
setSelectedKey( (key: Keynull )): voidSets the selected key.

Example#


See the docs for useStepList in react-aria for an example of useStepListState.