NumberPicker

fun NumberPicker(value: Int, onValueChange: (Int) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, range: IntRange = 0..10, label: (Int) -> String = { it.toString() }, visibleItemCount: Int = 5, wrapAround: Boolean = false, colors: NumberPickerColors = NumberPickerDefaults.colors(), textStyle: TextStyle = MiuixTheme.textStyles.title1, itemHeight: Dp = NumberPickerDefaults.ItemHeight)

A NumberPicker component with Miuix style.

A vertical scroll picker that displays a range of numbers with the selected value centered. Items fade out and scale down as they move away from the center.

Parameters

value

The current selected value. If outside range, it will be coerced into the range.

onValueChange

The callback invoked when the selected value changes.

modifier

The modifier to be applied to the NumberPicker.

enabled

Whether the NumberPicker is enabled for user interaction.

range

The range of selectable values.

label

A function that converts a value to its display string.

visibleItemCount

The number of visible items. Must be odd and at least 3.

wrapAround

Whether the picker wraps around from the last item to the first (infinite scrolling).

colors
textStyle

The TextStyle for the picker items.

itemHeight

The height of each item in the picker.