<h2 id="rememberlazystaggeredgridstate-initialfirstvisibleitemindex-initialfirstvisibleitemscrolloffset">rememberLazyStaggeredGridState</h2>

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

```kotlin
@Composable
fun rememberLazyStaggeredGridState(
    initialFirstVisibleItemIndex: Int = 0,
    initialFirstVisibleItemScrollOffset: Int = 0,
): LazyStaggeredGridState
```

Creates a [LazyStaggeredGridState](/jetpack-compose/androidx.compose.foundation/foundation/classes/LazyStaggeredGridState) that is remembered across composition.

Calling this function with different parameters on recomposition WILL NOT recreate or change the
state. Use [LazyStaggeredGridState.scrollToItem](/jetpack-compose/androidx.compose.foundation/foundation/classes/LazyStaggeredGridState) or [LazyStaggeredGridState.animateScrollToItem](/jetpack-compose/androidx.compose.foundation/foundation/classes/LazyStaggeredGridState)
to adjust position instead.

#### Parameters

| | |
| --- | --- |
| initialFirstVisibleItemIndex | initial position for [LazyStaggeredGridState.firstVisibleItemIndex](/jetpack-compose/androidx.compose.foundation/foundation/classes/LazyStaggeredGridState) |
| initialFirstVisibleItemScrollOffset | initial value for [LazyStaggeredGridState.firstVisibleItemScrollOffset](/jetpack-compose/androidx.compose.foundation/foundation/classes/LazyStaggeredGridState) |

#### Returns

| | |
| --- | --- |
|  | created and memoized [LazyStaggeredGridState](/jetpack-compose/androidx.compose.foundation/foundation/classes/LazyStaggeredGridState) with given parameters. |