The max current line (horizontal for vertical grids) the item can occupy, such that it will be positioned on the current line.
For example if LazyVerticalGrid has 3 columns this value will be 3 for the first cell in the line, 2 for the second cell, and 1 for the last one. If you return a span count larger than maxCurrentLineSpan this means we can't fit this cell into the current line, so the cell will be positioned on the next line.
The max line span (horizontal for vertical grids) an item can occupy. This will be the number of columns in vertical grids or the number of rows in horizontal grids.
For example if LazyVerticalGrid has 3 columns this value will be 3 for each cell.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-15 UTC.
[null,null,["Last updated 2025-05-15 UTC."],[],[],null,["# LazyGridItemSpanScope\n=====================\n\nArtifact: [androidx.compose.foundation:foundation](/jetpack/androidx/releases/compose-foundation) \n[View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/lazy/grid/LazyGridSpan.kt+class:androidx.compose.foundation.lazy.grid.LazyGridItemSpanScope) \nAdded in [1.2.0](/jetpack/androidx/releases/compose-foundation#1.2.0)\nCommon/All\n - Cmn \n\n ```\n @LazyGridScopeMarker\n sealed interface LazyGridItemSpanScope\n ```\n\n*** ** * ** ***\n\nScope of lambdas used to calculate the spans of items in lazy grids.\n\nSummary\n-------\n\n| ### Public properties |\n|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|\n| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [maxCurrentLineSpan](/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemSpanScope#maxCurrentLineSpan()) The max current line (horizontal for vertical grids) the item can occupy, such that it will be positioned on the current line. | Cmn |\n| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [maxLineSpan](/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemSpanScope#maxLineSpan()) The max line span (horizontal for vertical grids) an item can occupy. | Cmn |\n\nPublic properties\n-----------------\n\n### maxCurrentLineSpan\n\nCmn \nAdded in [1.2.0](/jetpack/androidx/releases/compose-foundation#1.2.0) \n\n```\nval maxCurrentLineSpan: Int\n```\n\nThe max current line (horizontal for vertical grids) the item can occupy, such that it will be positioned on the current line.\n\nFor example if [LazyVerticalGrid](/reference/kotlin/androidx/compose/foundation/lazy/grid/package-summary#LazyVerticalGrid(androidx.compose.foundation.lazy.grid.GridCells,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.grid.LazyGridState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,kotlin.Function1)) has 3 columns this value will be 3 for the first cell in the line, 2 for the second cell, and 1 for the last one. If you return a span count larger than [maxCurrentLineSpan](/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemSpanScope#maxCurrentLineSpan()) this means we can't fit this cell into the current line, so the cell will be positioned on the next line. \n\n### maxLineSpan\n\nCmn \nAdded in [1.2.0](/jetpack/androidx/releases/compose-foundation#1.2.0) \n\n```\nval maxLineSpan: Int\n```\n\nThe max line span (horizontal for vertical grids) an item can occupy. This will be the number of columns in vertical grids or the number of rows in horizontal grids.\n\nFor example if [LazyVerticalGrid](/reference/kotlin/androidx/compose/foundation/lazy/grid/package-summary#LazyVerticalGrid(androidx.compose.foundation.lazy.grid.GridCells,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.grid.LazyGridState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,kotlin.Function1)) has 3 columns this value will be 3 for each cell."]]