Lazy Grid

The main difference between LazyGrids vs LazyColumns is specifying column size using GridCells.

GridCells.Adaptive will stretch columns so that there is no empty space; while GridCells.FixedSize will not stretch columns and will leave empty space around the items.

Resize the browser window to see the difference in action.

Compose Multiplatform

Grid Item Span

An item can take up multiple slots via the span parameter.

Returning GridItemSpan(n) lets the item to take up n slots. Replace n with maxLineSpan to take up an entire row. Replace n with maxCurrentLineSpan to fill up rest of the row.

Compose Multiplatform

Staggered Grid

LazyStaggeredGrid can display items with different aspect ratios without leaving any unused space.

Compose Multiplatform