WheelPicker

fun <T : Any> WheelPicker(items: List<T>, selectedItem: T, onSelectedItemChange: (T) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, format: PickerItemFormat<T> = PickerDefaults.itemFormat(), style: PickerStyle = PickerDefaults.style(), semantics: PickerSemantics = PickerDefaults.semantics(), isInfinity: Boolean = true, onSelectionSettled: (T) -> Unit = {}, content: @Composable (PickerItemScope<T>) -> Unit? = null)

A controlled single-column wheel picker with separate live and settled selection callbacks.

Update selectedItem synchronously from onSelectedItemChange. The callback runs while a user scroll, item click, or semantics action moves a new item into the center. onSelectionSettled runs once after an interaction that changed the centered item stops. App-driven selectedItem changes synchronize the wheel without invoking either callback.

WheelPicker does not own or save arbitrary T values. Keep the selected value in app state; when T is not saveable, persist a stable saveable key and map it back to an item before composition.

To react only to settled selections - for example when a change triggers a query or rebuilds a dependent column - leave onSelectedItemChange empty and handle onSelectionSettled instead.

Parameters

items

The immutable list of unique items to display.

selectedItem

The controlled item currently selected by the app. It must exist in items.

onSelectedItemChange

Called whenever user interaction moves a different item into the center. Update selectedItem from this callback.

modifier

The modifier to be applied to the wheel picker.

enabled

Whether user scroll, click, and semantics selection actions are enabled.

format

Visible item text and optional accessibility value descriptions.

style

Visual and layout styling for the wheel picker.

semantics

Accessibility label and custom action labels for the wheel picker.

isInfinity

Whether the picker should loop infinitely.

onSelectionSettled

Called once when an interaction that changed the centered item settles. App-driven selectedItem synchronization does not invoke it.

content

Optional custom content composable for rendering each item.