Compose Component

ScrollField

ScrollField's can be used to provide a more interactive way to select a time or other numerical value.

ScrollField

Source set: Common
@ExperimentalMaterial3ExpressiveApi
@Composable
fun ScrollField(
    state: ScrollFieldState,
    modifier: Modifier = Modifier,
    colors: ScrollFieldColors = ScrollFieldDefaults.colors(),
    field: @Composable (index: Int, selected: Boolean) -> Unit = { index, selected ->
        ScrollFieldDefaults.Item(index = index, selected = selected, colors = colors)
    },
)

Parameters

state the state object to be used to control or observe the pager's state.
modifier the Modifier to be applied to the ScrollField container.
colors ScrollFieldColors that will be used to resolve the colors used for this ScrollField in different states.
field the composable used to render each item in the wheel.

Last updated: