PickerGroup

A group of Pickers to build components where multiple pickers are required to be combined together.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

PickerGroup

Android
@Composable
public fun PickerGroup(
    vararg pickers: PickerGroupItem,
    modifier: Modifier = Modifier,
    pickerGroupState: PickerGroupState = rememberPickerGroupState(),
    onSelected: (selectedIndex: Int) -> Unit = {},
    autoCenter: Boolean = true,
    propagateMinConstraints: Boolean = false,
    touchExplorationStateProvider: TouchExplorationStateProvider =
        DefaultTouchExplorationStateProvider(),
    separator: (@Composable (Int) -> Unit)? = null,
)

Parameters

pickers List of Pickers represented using PickerGroupItem in the same order of display from left to right.
modifier Modifier to be applied to the PickerGroup
pickerGroupState The state of the component
onSelected Action triggered when one of the Picker is selected inside the group
autoCenter Indicates whether the selected Picker should be centered on the screen. It is recommended to set this as true when all the pickers cannot be fit into the screen. Or provide a mechanism to navigate to pickers which are not visible on screen. If false, the whole row containing pickers would be centered.
propagateMinConstraints Whether the incoming min constraints should be passed to content.
touchExplorationStateProvider A TouchExplorationStateProvider to provide the current state of touch exploration service. This will be used to determine how the PickerGroup and talkback focus behaves/reacts to click and scroll events.
separator A composable block which describes the separator between different Pickers. The integer parameter to the composable depicts the index where it will be kept. For example, 0 would represent the separator between the first and second picker.