the amount of the requested scroll that was consumed (that is, how far it scrolled)
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-15 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-15 UTC."],[],[],null,["# ScrollScope\n===========\n\nArtifact: [androidx.compose.foundation:foundation](/jetpack/androidx/releases/compose-foundation) \n[View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/gestures/ScrollableState.kt+class:androidx.compose.foundation.gestures.ScrollScope) \nAdded in [1.0.0](/jetpack/androidx/releases/compose-foundation#1.0.0)\nCommon/AllAndroid/JVM\n - Cmn \n\n ```\n interface ScrollScope\n``` \nKnown direct subclasses \n[LazyLayoutScrollScope](/reference/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutScrollScope) \n\n|----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| [LazyLayoutScrollScope](/reference/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutScrollScope) | A [ScrollScope](/reference/kotlin/androidx/compose/foundation/gestures/ScrollScope) to allow customization of scroll sessions in LazyLayouts. |\n\n*** ** * ** ***\n\nScope used for suspending scroll blocks\n\nSummary\n-------\n\n| ### Public functions |\n|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|\n| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [scrollBy](/reference/kotlin/androidx/compose/foundation/gestures/ScrollScope#scrollBy(kotlin.Float))`(pixels: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Attempts to scroll forward by [pixels](/reference/kotlin/androidx/compose/foundation/gestures/ScrollScope#scrollBy(kotlin.Float)) px. | Cmn |\n\nPublic functions\n----------------\n\n### scrollBy\n\nCmn \nAdded in [1.0.0](/jetpack/androidx/releases/compose-foundation#1.0.0) \n\n```\nfun scrollBy(pixels: Float): Float\n```\n\nAttempts to scroll forward by [pixels](/reference/kotlin/androidx/compose/foundation/gestures/ScrollScope#scrollBy(kotlin.Float)) px. \n\n| Returns |\n|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\n| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | the amount of the requested scroll that was consumed (that is, how far it scrolled) |"]]