rememberPickerState

Composable Function

Android
@Composable
public fun rememberPickerState(
    @IntRange(from = 1) initialNumberOfOptions: Int,
    @IntRange(from = 0) initiallySelectedIndex: Int = 0,
    shouldRepeatOptions: Boolean = true,
): PickerState

Creates a PickerState that is remembered across compositions.

Parameters

initialNumberOfOptionsthe number of options.
initiallySelectedIndexthe index of the option to show in the center at the start, zero-based.
shouldRepeatOptionsif true (the default), the options will be repeated.