StylishPullToRefresh

fun StylishPullToRefresh(isRefreshing: Boolean, onRefresh: () -> Unit, modifier: Modifier = Modifier, state: PullToRefreshState = rememberPullToRefreshState(), contentAlignment: Alignment = Alignment.TopStart, indicator: @Composable BoxScope.() -> Unit = { PullToRefreshDefaults.Indicator( modifier = Modifier.align(Alignment.TopCenter), isRefreshing = isRefreshing, state = state, ) }, content: @Composable BoxScope.() -> Unit)

A pull-to-refresh container that wraps scrollable content and shows the Material 3 PullToRefreshDefaults.Indicator while a refresh is in progress.

This is the Finish-layer wrapper around the Material 3 PullToRefreshBox: it forwards every parameter unchanged, so callers get the standard M3 gesture, indicator, and state handling under the Stylish theme without importing the experimental pulltorefresh API. The indicator uses the active theme's colors via PullToRefreshDefaults.Indicator; pass a custom indicator to replace it.

Parameters

isRefreshing

Whether a refresh is currently occurring. Drive this from the parent (e.g. a LaunchedEffect around a network call).

onRefresh

Callback invoked when the user's pull crosses the refresh threshold.

modifier

Modifier applied to the container Box root.

state

The PullToRefreshState tracking the pull distance. Defaults to rememberPullToRefreshState.

contentAlignment

The default alignment inside the Box. Defaults to Alignment.TopStart.

indicator

The indicator drawn on top of the content while pulling or refreshing. Defaults to the Material 3 PullToRefreshDefaults.Indicator aligned to Alignment.TopCenter.

content

The scrollable content (e.g. a LazyColumn or a Modifier.verticalScroll layout). Receives BoxScope.

See also