Google is committed to advancing racial equity for Black communities. See how.

LazyListState

@Stable class LazyListState
kotlin.Any
   ↳ androidx.compose.foundation.lazy.LazyListState

A state object that can be hoisted to control and observe scrolling

In most cases, this will be created via rememberLazyListState.

Summary

Public constructors
<init>(firstVisibleItemIndex: Int = 0, firstVisibleItemScrollOffset: Int = 0, flingConfig: FlingConfig, animationClock: AnimationClockObservable)

A state object that can be hoisted to control and observe scrolling

Companion functions
Saver<LazyListState, *>
Saver(flingConfig: FlingConfig, animationClock: AnimationClockObservable)

The default Saver implementation for LazyListState.

Properties
Int

The index of the first item that is visible

Int

The scroll offset of the first visible item.

Public constructors

<init>

LazyListState(
    firstVisibleItemIndex: Int = 0,
    firstVisibleItemScrollOffset: Int = 0,
    flingConfig: FlingConfig,
    animationClock: AnimationClockObservable)

A state object that can be hoisted to control and observe scrolling

In most cases, this will be created via rememberLazyListState.

Properties

firstVisibleItemIndex

val firstVisibleItemIndex: Int

The index of the first item that is visible

firstVisibleItemScrollOffset

val firstVisibleItemScrollOffset: Int

The scroll offset of the first visible item. Scrolling forward is positive - i.e., the amount that the item is offset backwards

Companion functions

Saver

fun Saver(
    flingConfig: FlingConfig,
    animationClock: AnimationClockObservable
): Saver<LazyListState, *>

The default Saver implementation for LazyListState.