Composables UI is out: our new component library for Compose Multiplatform ->
Property

firstVisibleItemLayoutItemInfo

Returns the TransformingLazyColumnFirstLayoutItemProvider.ItemInfo for the first visible item aligned to its TransformingLazyColumnFirstLayoutItemProvider.ItemEdge.Start edge, or null if there are no visible items.

Source set: Android
public val TransformingLazyColumnState.firstVisibleItemLayoutItemInfo:
TransformingLazyColumnFirstLayoutItemProvider.ItemInfo?

Returns the TransformingLazyColumnFirstLayoutItemProvider.ItemInfo for the first visible item aligned to its TransformingLazyColumnFirstLayoutItemProvider.ItemEdge.Start edge, or null if there are no visible items.

This extension is useful when building a custom TransformingLazyColumnFirstLayoutItemProvider that needs to ensure the first visible item maintains a static start edge during dynamic content updates (such as item additions, removals, or size changes), avoiding visual jumps in the viewport.

Since the first visible item changes rapidly during an active scroll, tracking it continuously does not provide a stable visual reference. When using this property with rememberTransformingLazyColumnFirstLayoutItemProvider, it is highly recommended to yield to the default layout behavior by returning null when TransformingLazyColumnState.isScrollInProgress is true. This allows the list to fall back to its default layout behavior, which accurately tracks the scroll gesture, while also avoiding unnecessary computational overhead.

Last updated: