# pullToRefresh

Common/All

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.https://developer.android.com/reference/kotlin/androidx/compose/material3/pulltorefresh/pullToRefresh.modifier#(androidx.compose.ui.Modifier).pullToRefresh(kotlin.Boolean,androidx.compose.material3.pulltorefresh.PullToRefreshState,kotlin.Boolean,androidx.compose.ui.unit.Dp,kotlin.Function0)( isRefreshing: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, state: https://developer.android.com/reference/kotlin/androidx/compose/material3/pulltorefresh/PullToRefreshState, enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, threshold: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, onRefresh: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` A Modifier that adds nested scroll to a container to support a pull-to-refresh gesture. | Cmn |

## Functions

### Modifier.pullToRefresh

Cmn Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/pulltorefresh/PullToRefresh.kt+function:pullToRefresh)

```
fun Modifier.pullToRefresh(
    isRefreshing: Boolean,
    state: PullToRefreshState,
    enabled: Boolean = true,
    threshold: Dp = PullToRefreshDefaults.PositionalThreshold,
    onRefresh: () -> Unit
): Modifier
```

A Modifier that adds nested scroll to a container to support a pull-to-refresh gesture. When the user pulls a distance greater than `https://developer.android.com/reference/kotlin/androidx/compose/material3/pulltorefresh/package-summary#(androidx.compose.ui.Modifier).pullToRefresh(kotlin.Boolean,androidx.compose.material3.pulltorefresh.PullToRefreshState,kotlin.Boolean,androidx.compose.ui.unit.Dp,kotlin.Function0)` and releases the gesture, `https://developer.android.com/reference/kotlin/androidx/compose/material3/pulltorefresh/package-summary#(androidx.compose.ui.Modifier).pullToRefresh(kotlin.Boolean,androidx.compose.material3.pulltorefresh.PullToRefreshState,kotlin.Boolean,androidx.compose.ui.unit.Dp,kotlin.Function0)` is invoked. `https://developer.android.com/reference/kotlin/androidx/compose/material3/pulltorefresh/PullToRefreshBox.composable#PullToRefreshBox(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.material3.pulltorefresh.PullToRefreshState,androidx.compose.ui.Alignment,kotlin.Function1,kotlin.Boolean,androidx.compose.ui.unit.Dp,kotlin.Function1)` applies this automatically.

| Parameters |
|---|---|
| `isRefreshing: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | whether a refresh is occurring or not, if there is no gesture in progress when isRefreshing is false the `state.distanceFraction` will animate to 0f, otherwise it will animate to 1f |
| `state: https://developer.android.com/reference/kotlin/androidx/compose/material3/pulltorefresh/PullToRefreshState` | state that keeps track of the distance pulled |
| `enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | whether nested scroll events should be consumed by this modifier |
| `threshold: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = PullToRefreshDefaults.PositionalThreshold` | how much distance can be scrolled down before `https://developer.android.com/reference/kotlin/androidx/compose/material3/pulltorefresh/package-summary#(androidx.compose.ui.Modifier).pullToRefresh(kotlin.Boolean,androidx.compose.material3.pulltorefresh.PullToRefreshState,kotlin.Boolean,androidx.compose.ui.unit.Dp,kotlin.Function0)` is invoked |
| `onRefresh: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | callback that is invoked when the distance pulled is greater than `https://developer.android.com/reference/kotlin/androidx/compose/material3/pulltorefresh/package-summary#(androidx.compose.ui.Modifier).pullToRefresh(kotlin.Boolean,androidx.compose.material3.pulltorefresh.PullToRefreshState,kotlin.Boolean,androidx.compose.ui.unit.Dp,kotlin.Function0)` |