useSingleSelectListState
Provides state management for list-like components with single selection. Handles building a collection of items from props, and manages selection state.
install | yarn add @react-stately/list |
---|---|
version | 3.2.1 |
usage | import {useSingleSelectListState} from '@react-stately/list' |
API#
useSingleSelectListState<T>(
(props: <T>
)): <T>
Interface#
Properties
Name | Type | Description |
selectedKey | Key | The key for the currently selected item. |
selectedItem | <T> | The value of the currently selected item. |
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. |
Methods
Method | Description |
setSelectedKey(
(key: Key
)): void | Sets the selected key. |