---
title: "scrollBy"
description: "Action to asynchronously scroll by a specified amount.

[scrollByOffset] should be preferred in most cases, since it is synchronous and returns the
amount of scroll that was actually consumed.

Expected to be used in conjunction with [verticalScrollAxisRange]/[horizontalScrollAxisRange]."
type: "function"
---

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


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


```kotlin
fun SemanticsPropertyReceiver.scrollBy(
    label: String? = null,
    action: ((x: Float, y: Float) -> Boolean)?,
)
```


Action to asynchronously scroll by a specified amount.

`scrollByOffset` should be preferred in most cases, since it is synchronous and returns the
amount of scroll that was actually consumed.

Expected to be used in conjunction with `verticalScrollAxisRange`/`horizontalScrollAxisRange`.

#### Parameters

| | |
| --- | --- |
| label | Optional label for this action. |
| action | Action to be performed when `SemanticsActions.ScrollBy` is called. |




