State of Compose 2023 results are in! Click here to learn more

← Back to Foundation

ScrollerPosition

Component
in
Foundation
. Since 0.1.0-dev15

Overview

Code Examples

Create and remember the state for a VerticalScroller or HorizontalScroller based on the currently appropriate scroll configuration to allow changing scroll position or observing scroll behavior.

@param initial initial scroller position to start with @param isReversed whether position will be reversed, e.g. 0 will mean bottom for VerticalScroller and end for HorizontalScroller

Overloads

ScrollerPosition

@Deprecated(
    "Use rememberScrollState instead", replaceWith = ReplaceWith(
        "rememberScrollState(initial = initial",
        "androidx.compose.foundation.rememberScrollState"
    )
)
@Composable
fun ScrollerPosition(
    initial: Float = 0f,
    isReversed: Boolean = false
)

Parameters

NameDescription
initialinitial scroller position to start with
isReversedwhether position will be reversed, e.g. 0 will mean bottom for VerticalScroller and end for HorizontalScroller