PickerGroupItem
Class
Android
public class PickerGroupItem(
public val pickerState: PickerState,
public val modifier: Modifier = Modifier,
public val contentDescription: String? = null,
public val focusRequester: FocusRequester? = null,
public val onSelected: () -> Unit = {},
public val readOnlyLabel: @Composable (BoxScope.() -> Unit)? = null,
public val option: @Composable PickerScope.(optionIndex: Int, pickerSelected: Boolean) -> Unit,
)
A class for representing Picker
which will be composed inside a PickerGroup
.
Parameters
pickerState | The state of the picker |
modifier | Modifier to be applied to the Picker |
contentDescription | Text used by accessibility services to describe what the selected option represents. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar. Typically, the content description is inferred via derivedStateOf to avoid unnecessary recompositions, like this: val description by remember { derivedStateOf { /* expression using state.selectedOption */ } } |
focusRequester | Optional FocusRequester for the Picker . If not provided, a local instance of FocusRequester will be created to handle the focus between different pickers |
onSelected | Action triggered when the Picker is selected by clicking |
readOnlyLabel | A slot for providing a label, displayed above the selected option when the Picker is read-only. The label is overlaid with the currently selected option within a Box, so it is recommended that the label is given Alignment.TopCenter . |
option | A block which describes the content. The integer parameter to the composable denotes the index of the option and boolean denotes whether the picker is selected or not. |