androidx.compose.foundation

verticalScroll

Function · from org.jetbrains.compose.foundation:foundation:1.12.2

No hand-written docs yet.

Modify element to allow to scroll vertically when height of the content is bigger than max constraints allow.

Form 1

fun Modifier.verticalScroll(
    state: ScrollState,
    enabled: Boolean = true,
    flingBehavior: FlingBehavior? = null,
    reverseScrolling: Boolean = false,
)

state: ScrollStateRequired

state of the scroll

enabled: BooleanOptional

Default: true

whether or not scrolling via touch input is enabled

flingBehavior: FlingBehavior?Optional

Default: null

logic describing fling behavior when drag has finished with velocity. If null, default from ScrollableDefaults.flingBehavior will be used.

reverseScrolling: BooleanOptional

Default: false

reverse the direction of scrolling, when true, 0 ScrollState.value will mean bottom, when false, 0 ScrollState.value will mean top

With overscrollEffectSince 1.8

fun Modifier.verticalScroll(
    state: ScrollState,
    overscrollEffect: OverscrollEffect?,
    enabled: Boolean = true,
    flingBehavior: FlingBehavior? = null,
    reverseScrolling: Boolean = false,
)

overscrollEffect: OverscrollEffect?Required

the OverscrollEffect that will be used to render overscroll for this modifier. Note that the OverscrollEffect.node will be applied internally as well - you do not need to use Modifier.overscroll separately.

Same as above: state, enabled, flingBehavior, reverseScrolling.

Library docs

Modify element to allow to scroll vertically when height of the content is bigger than max constraints allow.