Screen

fun Screen(id: String, events: EventSchemaBuilderScope.() -> Unit = {}, navigationDrawerTiles: TileSchemaBuilderScope.() -> Unit? = null, ttl: LocalDateTime? = null, tiles: TileSchemaBuilderScope.() -> Unit = {}): ScreenResponse

Builds a standalone screen — the top-level entry point for a non-graph endpoint, returning the ScreenResponse the client fetches and renders. For a screen that lives inside a back stack, use entry under dev.catbit.mosaic.server.builder.graph.Graph instead.

Parameters

id

Unique identifier of the screen, referenced by Navigate(destination = id).

events

Screen-level events, e.g. an initial GetData/SendNetworkRequest run on display.

navigationDrawerTiles

Tiles rendered inside a ModalNavigationDrawer for this screen. Defaults to none (no drawer).

ttl

Cache expiry — the client re-fetches this screen after this datetime instead of using its cached copy. Defaults to none (cached indefinitely).

tiles

Tile tree rendered as the screen's content.