rememberPickerState

Composable Function

Android
@Composable
public fun rememberPickerState(
    initialNumberOfOptions: Int,
    initiallySelectedOption: Int = 0,
    repeatItems: Boolean = true,
): PickerState

Creates a PickerState that is remembered across compositions.

Parameters

initialNumberOfOptionsthe number of options
initiallySelectedOptionthe option to show in the center at the start
repeatItemsif true (the default), the contents of the component will be repeated