We just launched Compose Examples featuring over 150+ components! Check it out →

pullToRefreshIndicator

Common

Modifier in Material 3 Compose

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")
}

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,
): Modifier

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
by @alexstyl