alpha

useStepListState

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

API#


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

Interface#


z

Properties

NameTypeDescription
selectedKeyKeyThe key for the currently selected item.
selectedItemNode<T>The 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.