---
title: "animateScrollToItem"
description: "Animate (smooth scroll) the given item at [index] to the center of the viewport and position it based on the [Configuration.anchorType] and applies the [scrollOffset] pixels."
type: "function"
lastmod: "2026-08-27"
---
## API Reference

### animateScrollToItem

> Source set: Android

```kotlin
public suspend fun animateScrollToItem(
        /*@IntRange(from = 0)*/
        index: Int,
        /*@IntRange(from = 0)*/
        scrollOffset: Int = 0,
    )
```

Animate (smooth scroll) the given item at `index` to the center of the viewport and position
it based on the `Configuration.anchorType` and applies the `scrollOffset` pixels.

#### Parameters

| | |
| --- | --- |
| index | the index to which to scroll. Must be non-negative. |
| scrollOffset | the offset that the item should end up after the scroll (same as [scrollToItem](/jetpack-compose/androidx.wear.compose/compose-foundation/functions/scrollToItem)) - note that positive offset refers to forward scroll, so in a top-to-bottom list, positive offset will scroll the item further upward (taking it partly offscreen) |
