PullToRefresh

fun TileSchemaBuilderScope.PullToRefresh(id: String = randomId(), tiles: TileSchemaBuilderScope.() -> Unit, events: EventSchemaBuilderScope.() -> Unit = {}, style: StyleSchemaBuilderScope.() -> Unit = {}, visibility: TileSchema.Visibility = visible(), searchableTerms: List<String>? = null, isRefreshing: Boolean = false)

Renders a Material 3 pull-to-refresh container wrapping tiles, showing the refresh indicator while isRefreshing is true. Pulling flips isRefreshing to true locally on the client (no round trip needed for the spinner to appear) and dispatches onPull — hook the refresh work to that trigger. Stopping the indicator is the server's job: chain a StopRefreshingEventSchema pointing at this tile's id onto the end of the refresh flow, on both the success and failure branch, otherwise it keeps spinning. Children are laid out with Box semantics and no scope CompositionLocal; put a scrollable tile inside for the gesture to feel natural. Dispatches onDisplay once when composed.

Parameters

id

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

tiles

Child tiles wrapped by the pull-to-refresh container.

events

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

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.

isRefreshing

Whether the refresh indicator is currently shown.