JengaGrid

fun JengaGrid(columns: Int, modifier: Modifier = Modifier, horizontalSpace: Dp = JengaTheme.spacing.md, verticalSpace: Dp = JengaTheme.spacing.md, content: @Composable () -> Unit)(source)

A non-scrolling grid that lays children out in columns equal-width columns with token gaps, the "stop nesting Rows of Columns" primitive. (Braid Tiles / Polaris InlineGrid / Chakra SimpleGrid.)

For large, scrolling data sets prefer a LazyVerticalGrid; this is for a bounded set of UI blocks composed inline.

Parameters

columns

number of equal columns (>= 1).

modifier

the Modifier for the grid (must be width-bounded).

horizontalSpace

gap between columns; defaults to spacing.md.

verticalSpace

gap between rows; defaults to spacing.md.

content

the grid cells; each becomes one cell, filling its column width.

Samples

JengaGrid(
    columns = 2,
    content = {
        JengaText(
            text = "1",
        )
        JengaText(
            text = "2",
        )
        JengaText(
            text = "3",
        )
        JengaText(
            text = "4",
        )
    },
)