---
title: "animateScrollToItem"
description: "Animate (smooth scroll) to the given item."
type: "function"
---
## API Reference

### animateScrollToItem

> Source set: Common

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

Animate (smooth scroll) to the given item.

#### Parameters

| | |
| --- | --- |
| index | the index to which to scroll. Must be non-negative. |
| scrollOffset | the offset that the item should end up after the scroll. 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). |
