useListState
Provides state management for list-like components. Handles building a collection of items from props, and manages multiple selection state.
install | yarn add @react-stately/list |
---|---|
version | 3.2.1 |
usage | import {useListState} from '@react-stately/list' |
API#
useListState<T>(
(props: <T>
)): <T>
Interface#
Name | Type | Description |
collection | <<T>> | A collection of items in the list. |
disabledKeys | Set<Key> | A set of items that are disabled. |
selectionManager |
| A selection manager to read and update multiple selection state. |
Example#
See the docs for useListBox in react-aria for an example of useListState
.