---
title: "scrollBy"
description: "Jump instantly by [value] pixels.

Cancels the currently running scroll, if any, and suspends until the cancellation is complete."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
suspend fun ScrollableState.scrollBy(value: Float): Float
```


Jump instantly by `value` pixels.

Cancels the currently running scroll, if any, and suspends until the cancellation is complete.

#### Parameters

| | |
| --- | --- |
| value | number of pixels to scroll by |


#### Returns

| | |
| --- | --- |
|  | the amount of scroll consumed |




<div class='sourceset sourceset-common'>Common</div>


```kotlin
suspend fun Scrollable2DState.scrollBy(value: Offset): Offset
```


Jump instantly by `value` pixels.

Cancels the currently running scroll, if any, and suspends until the cancellation is complete.

#### Parameters

| | |
| --- | --- |
| value | number of pixels to scroll by |


#### Returns

| | |
| --- | --- |
|  | the amount of scroll consumed |




