LazyStaggeredGridItemScope

Interface

Common
@LazyStaggeredGridScopeMarker
sealed interface LazyStaggeredGridItemScope

Receiver scope for itemContent in LazyStaggeredGridScope.item

Functions

fun Modifier.animateItem(
        fadeInSpec: FiniteAnimationSpec<Float>? = spring(stiffness = Spring.StiffnessMediumLow),
        placementSpec: FiniteAnimationSpec<IntOffset>? =
            spring(
                stiffness = Spring.StiffnessMediumLow,
                visibilityThreshold = IntOffset.VisibilityThreshold,
            ),
        fadeOutSpec: FiniteAnimationSpec<Float>? = spring(stiffness = Spring.StiffnessMediumLow),
    ): Modifier

This modifier animates the item appearance (fade in), disappearance (fade out) and placement changes (such as an item reordering).

You should also provide a key via LazyStaggeredGridScope.item/ LazyStaggeredGridScope.items for this modifier to enable animations.

Parameters

fadeInSpecan animation specs to use for animating the item appearance. When null is provided the item will be appearing without animations.
placementSpecan animation specs that will be used to animate the item placement. Aside from item reordering all other position changes caused by events like arrangement or alignment changes will also be animated. When null is provided no animations will happen.
fadeOutSpecan animation specs to use for animating the item disappearance. When null is provided the item will be disappearance without animations.