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


<a id='references'></a>


<h2 id="animatescrollby-value-animationspec">animateScrollBy</h2>

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


```kotlin
suspend fun ScrollableState.animateScrollBy(
    value: Float,
    animationSpec: AnimationSpec<Float> = spring(),
): Float
```


Scroll by `value` pixels with animation.

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

#### Parameters

| | |
| --- | --- |
| value | number of pixels to scroll by |
| animationSpec | `AnimationSpec` to be used for this scrolling |


#### Returns

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






<hr class="docs-overload-divider">


<h2 id="animatescrollby-value-animationspec-2">animateScrollBy</h2>

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


```kotlin
suspend fun Scrollable2DState.animateScrollBy(
    value: Offset,
    animationSpec: AnimationSpec<Offset> = spring(),
): Offset
```


Scroll by `value` pixels with animation.

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

#### Parameters

| | |
| --- | --- |
| value | number of pixels to scroll by |
| animationSpec | `AnimationSpec` to be used for this scrolling |


#### Returns

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