State of Compose 2023 results are in! Click here to learn more

← Back to Glance AppWidget

LazyVerticalGrid

Component
in
Glance AppWidget
. Since 1.0.0

Overview

Code Examples

Video

The DSL implementation of a lazy grid layout. It composes only visible rows of the grid.

@param gridCells the number of columns in the grid. @param modifier the modifier to apply to this layout @param horizontalAlignment the horizontal alignment applied to the items. @param content a block which describes the content. Inside this block you can use methods like LazyVerticalGridScope.item to add a single item or LazyVerticalGridScope.items to add a list of items.

Overloads

LazyVerticalGrid

@Composable
fun LazyVerticalGrid(
    gridCells: GridCells,
    modifier: GlanceModifier = GlanceModifier,
    horizontalAlignment: Alignment.Horizontal = Alignment.Start,
    content: LazyVerticalGridScope.() -> Unit
)

Parameters

NameDescription
gridCellsthe number of columns in the grid.
modifierthe modifier to apply to this layout
horizontalAlignmentthe horizontal alignment applied to the items.
contenta block which describes the content. Inside this block you can use methods like LazyVerticalGridScope.item to add a single item or LazyVerticalGridScope.items to add a list of items