Start native apps faster with the Composables CLI ->
Object

ScrollableDefaults

Contains the default values used by scrollable

Source set: Common
public object ScrollableDefaults

Contains the default values used by scrollable

Functions

flingBehavior

Source set: Common
@Composable public fun flingBehavior(): FlingBehavior

Create and remember default FlingBehavior that will represent a natural fling curve.

overscrollEffect

Source set: Common
@Deprecated(
        "This API has been replaced with rememberOverscrollEffect, which queries theme provided OverscrollFactory values instead of the 'platform default' without customization.",
        replaceWith =
            ReplaceWith(
                "rememberOverscrollEffect()",
                "androidx.compose.foundation.rememberOverscrollEffect",
            ),
    )
    @Composable
    public fun overscrollEffect(): OverscrollEffect

Returns a remembered OverscrollEffect created from the current value of LocalOverscrollFactory.

This API has been deprecated, and replaced with rememberOverscrollEffect

reverseDirection

Source set: Common
public fun reverseDirection(
        layoutDirection: LayoutDirection,
        orientation: Orientation,
        reverseScrolling: Boolean,
    ): Boolean

Calculates the final reverseDirection value for a scrollable component.

This is a helper function used by androidx.compose.foundation.scrollableArea to determine whether to reverse the direction of scroll input. The goal is to provide a "natural" scrolling experience where content moves with the user's gesture, while also accounting for the layoutDirection.

The logic is as follows:

    inverted. This function returns true by default when reverseScrolling is false.

  1. To achieve "natural" scrolling (content moves with the gesture), scroll deltas are
  2. flipped an additional time to maintain the natural feel, as the content is laid out from right to left.

  3. In a Right-to-Left (Rtl) context with a Horizontal orientation, the direction is

Parameters

layoutDirection current layout direction (e.g., from LocalLayoutDirection)
orientation orientation of scroll
reverseScrolling whether scrolling direction should be reversed

Return

true if scroll direction should be reversed, false otherwise.