Grid

fun UiScope.Grid(columns: Int, modifier: Modifier = Modifier.Empty, key: ElementKey<*>? = null, horizontalSpacing: Int = 0, verticalSpacing: Int = 0, contentAlignment: Alignment = Alignment.TopStart, content: GridScope.() -> Unit)(source)

Emits one fixed-column grid with the descriptions produced by its callback.

Children are assigned to cells in row-major order. Every column uses the greatest measured width in that column and every row uses the greatest measured height in that row. An incomplete final row is supported without creating placeholder children.

Parameters

columns

positive number of columns.

modifier

ordered active behavior applied to the grid itself, including sizing, padding, paint, semantics, focus, and input behavior.

key

optional stable identity among direct siblings.

horizontalSpacing

non-negative fixed spacing between adjacent columns.

verticalSpacing

non-negative fixed spacing between adjacent rows.

contentAlignment

default placement of each child inside its measured cell.

content

callback that emits zero or more direct children.

Throws

when columns is not positive or either spacing value is negative.

when the enclosing scope has escaped its callback or constructing thread.

when content fails; the exact callback failure is propagated.