🌈 Create new beautiful Compose Gradients with our new wesite ->
Composable Function

rememberLazyStaggeredGridState

Creates a LazyStaggeredGridState that is remembered across composition.

rememberLazyStaggeredGridState

Source set: Common
@Composable
public fun rememberLazyStaggeredGridState(
    initialFirstVisibleItemIndex: Int = 0,
    initialFirstVisibleItemScrollOffset: Int = 0,
): LazyStaggeredGridState

Creates a LazyStaggeredGridState that is remembered across composition.

Calling this function with different parameters on recomposition WILL NOT recreate or change the state. Use LazyStaggeredGridState.scrollToItem or LazyStaggeredGridState.animateScrollToItem to adjust position instead.

Parameters

initialFirstVisibleItemIndex initial position for LazyStaggeredGridState.firstVisibleItemIndex
initialFirstVisibleItemScrollOffset initial value for LazyStaggeredGridState.firstVisibleItemScrollOffset

Return

created and memoized LazyStaggeredGridState with given parameters.