LazyTiles

fun TileSchemaBuilderScope.LazyTiles(id: String = randomId(), events: EventSchemaBuilderScope.() -> Unit = {}, style: StyleSchemaBuilderScope.() -> Unit = {}, visibility: TileSchema.Visibility = visible(), searchableTerms: List<String>? = null, url: String, method: HttpMethod = HttpMethod.GET, body: AnySerializable? = null, headers: Map<String, String>? = null, failureTiles: TileSchemaBuilderScope.() -> Unit = {}, placeholderTiles: TileSchemaBuilderScope.() -> Unit = {})

Renders a plain Column whose content is fetched from the network at display time: the tile calls url with method, body and headers, expects a JSON array of tile schemas back, and renders them in place of placeholderTiles. placeholderTiles are shown while the request is in flight (fired once, on the IO dispatcher), and failureTiles replace them if the request or the response decoding fails. A local reload event clears the loaded state and retries. The request is issued directly by the renderer, not through the event pipeline, so it is not affected by event chaining. Children are laid out with no scope CompositionLocal and no scrolling.

Parameters

id

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

events

Events owned by this tile, wired to its triggers (onDisplay, load-start, load-success, load-failure).

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.

url

URL requested to fetch the JSON array of tile schemas to render.

method

HTTP method used for the request. Defaults to GET.

body

Request body sent with the request. Defaults to none.

headers

Request headers sent with the request. Defaults to none.

failureTiles

Tiles rendered when the request or response decoding fails. Defaults to none.

placeholderTiles

Tiles rendered while the request is in flight. Defaults to none.