New Compose Multiplatform components arrived on Composables UICheck it out →

Modifier in Material 3 Compose

pullToRefreshIndicator

Common

A Modifier that handles the size, offset, clipping, shadow, and background drawing of a pull-to-refresh indicator, useful when implementing custom indicators. [PullToRefreshDefaults.Indicator] applies this automatically.

Last updated:

Installation

dependencies {
   implementation("androidx.compose.material3:material3:1.3.0-beta04")
}

Overloads

@ExperimentalMaterial3Api
fun Modifier.pullToRefreshIndicator(
    state: PullToRefreshState,
    isRefreshing: Boolean,
    threshold: Dp = PullToRefreshDefaults.PositionalThreshold,
    shape: Shape = PullToRefreshDefaults.shape,
    containerColor: Color = Color.Unspecified,
    elevation: Dp = PullToRefreshDefaults.Elevation,
)

Parameters

namedescription
statethe state of this modifier, will use state.distanceFraction and [threshold] to calculate the offset
isRefreshingwhether a refresh is occurring
thresholdhow much the indicator can be pulled down before a refresh is triggered on release
shapethe [Shape] of this indicator
containerColorthe container color of this indicator
elevationthe elevation for the indicator