class PickerGroupItem


A class for representing Picker which will be composed inside a PickerGroup.

Summary

Public constructors

PickerGroupItem(
    pickerState: PickerState,
    modifier: Modifier,
    contentDescription: String?,
    focusRequester: FocusRequester?,
    onSelected: () -> Unit,
    readOnlyLabel: (@Composable BoxScope.() -> Unit)?,
    spacing: Dp,
    option: @Composable PickerScope.(optionIndex: Int, pickerSelected: Boolean) -> Unit
)

Public properties

String?

Text used by accessibility services to describe what the selected option represents.

FocusRequester?

Optional FocusRequester for the Picker.

Modifier

Modifier to be applied to the Picker.

() -> Unit

Action triggered when the Picker is selected by clicking.

@Composable PickerScope.(optionIndex: Int, pickerSelected: Boolean) -> Unit

A block which describes the content.

PickerState

The state of the picker.

(@Composable BoxScope.() -> Unit)?

A slot for providing a label, displayed above the selected option when the Picker is read-only.

Dp

The amount of spacing in Dp between items.

Public constructors

PickerGroupItem

PickerGroupItem(
    pickerState: PickerState,
    modifier: Modifier = Modifier,
    contentDescription: String? = null,
    focusRequester: FocusRequester? = null,
    onSelected: () -> Unit = {},
    readOnlyLabel: (@Composable BoxScope.() -> Unit)? = null,
    spacing: Dp = 0.dp,
    option: @Composable PickerScope.(optionIndex: Int, pickerSelected: Boolean) -> Unit
)
Parameters
pickerState: PickerState

The state of the picker.

modifier: Modifier = Modifier

Modifier to be applied to the Picker.

contentDescription: String? = null

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: FocusRequester? = null

Optional FocusRequester for the Picker. If not provided, a local instance of FocusRequester will be created to handle the focus between different pickers.

onSelected: () -> Unit = {}

Action triggered when the Picker is selected by clicking.

readOnlyLabel: (@Composable BoxScope.() -> Unit)? = null

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.

spacing: Dp = 0.dp

The amount of spacing in Dp between items. Can be negative, which can be useful for Text if it has plenty of whitespace.

option: @Composable PickerScope.(optionIndex: Int, pickerSelected: Boolean) -> Unit

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.

Public properties

contentDescription

Added in 1.0.0-alpha25
val contentDescriptionString?

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

Added in 1.0.0-alpha25
val focusRequesterFocusRequester?

Optional FocusRequester for the Picker. If not provided, a local instance of FocusRequester will be created to handle the focus between different pickers.

modifier

Added in 1.0.0-alpha25
val modifierModifier

Modifier to be applied to the Picker.

onSelected

Added in 1.0.0-alpha25
val onSelected: () -> Unit

Action triggered when the Picker is selected by clicking.

option

Added in 1.0.0-alpha25
val option: @Composable PickerScope.(optionIndex: Int, pickerSelected: Boolean) -> Unit

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.

pickerState

Added in 1.0.0-alpha25
val pickerStatePickerState

The state of the picker.

readOnlyLabel

Added in 1.0.0-alpha25
val readOnlyLabel: (@Composable BoxScope.() -> Unit)?

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.

spacing

Added in 1.0.0-alpha25
val spacingDp

The amount of spacing in Dp between items. Can be negative, which can be useful for Text if it has plenty of whitespace.