Grid

fun TileSchemaBuilderScope.Grid(id: String = randomId(), events: EventSchemaBuilderScope.() -> Unit = {}, style: StyleSchemaBuilderScope.() -> Unit = {}, visibility: TileSchema.Visibility = visible(), searchableTerms: List<String>? = null, filterChildrenByTerm: String? = null, flow: GridTileSchema.GridFlowSchema = flowGridThroughRows(), columns: List<GridTileSchema.GridTrackSchema>, rows: List<GridTileSchema.GridTrackSchema>, columnGap: Int = 0, rowGap: Int = 0, tiles: TileSchemaBuilderScope.() -> Unit)

Renders a Compose CSS-grid-like layout hosting tiles. columns and rows declare the track template (each track fixed in dp, a fraction of available space, an fr-flexible unit, auto, max-content or min-content); when rows is left empty, row tracks are derived implicitly. flow decides whether children are placed row-first or column-first, and columnGap / rowGap (in dp) set the spacing between tracks. Publishes its grid scope to children so they can use grid modifiers (row/column span and placement). When filterChildrenByTerm is set, only children whose searchableTerms contain that term (case-insensitive substring match) are rendered — children without searchableTerms are filtered out. Never scrollable — every child is composed eagerly. Dispatches onDisplay once when composed, onClick/onLongPress only when declared on this tile.

Parameters

id

Unique identifier of the tile. Defaults to a random id.

events

Events owned by this tile, wired to its triggers (onDisplay, onClick, onLongPress).

style

Layout/appearance modifiers (size, padding, background, etc).

visibility

Whether the tile is shown, hidden but occupies space, or removed from layout. Defaults to visible.

searchableTerms

Terms used by an ancestor's search/filter to decide whether this tile matches. Defaults to none.

filterChildrenByTerm

Term used to filter tiles by their own searchableTerms. Defaults to none (no filtering).

flow

Whether children are auto-placed row-first or column-first. Defaults to row-first.

columns

Column track template.

rows

Row track template. When empty, rows are derived implicitly.

columnGap

Spacing between columns, in dp. Defaults to 0.

rowGap

Spacing between rows, in dp. Defaults to 0.

tiles

Child tiles placed into the grid.