# ScrollScope

# ScrollScope

Artifact:[androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/gestures/ScrollableState.kt+class:androidx.compose.foundation.gestures.ScrollScope)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)
Common/AllAndroid/JVM
  - Cmn  

  ```
  interface ScrollScope
```  
Known direct subclasses  
[LazyLayoutScrollScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutScrollScope)  

|---------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [LazyLayoutScrollScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutScrollScope) | A[ScrollScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/ScrollScope)to allow customization of scroll sessions in LazyLayouts. |

*** ** * ** ***

Scope used for suspending scroll blocks

## Summary

|                              ### Public functions                               |
|---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [scrollBy](https://developer.android.com/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](https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/ScrollScope#scrollBy(kotlin.Float))px. | Cmn |

## Public functions

### scrollBy

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)  

```
fun scrollBy(pixels: Float): Float
```

Attempts to scroll forward by[pixels](https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/ScrollScope#scrollBy(kotlin.Float))px.  

|                                     Returns                                     |
|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| [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) |