# SwipeToRevealDefaults

Artifact: [androidx.wear.compose:compose-material3](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material3/SwipeToReveal.kt+class:androidx.wear.compose.material3.SwipeToRevealDefaults) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)


```
object SwipeToRevealDefaults
```

<br />

*** ** * ** ***

Defaults for Material 3 `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToReveal.composable#SwipeToReveal(kotlin.Function1,kotlin.Function0,androidx.wear.compose.material3.SurfaceTransformation,androidx.compose.ui.Modifier,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.compose.material3.RevealState,androidx.wear.compose.material3.RevealDirection,kotlin.Boolean,androidx.wear.compose.foundation.GestureInclusion,androidx.compose.ui.unit.Dp,kotlin.Function0)`.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToRevealDefaults#flingBehavior(androidx.wear.compose.material3.RevealState)(revealState: https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RevealState)` Creates and remembers the default fling behavior used by the SwipeToReveal component. |
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/GestureInclusion` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToRevealDefaults#gestureInclusion(androidx.wear.compose.material3.RevealState,kotlin.Float)( state: https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RevealState, edgeZoneFraction: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` The default behaviour for when `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToReveal.composable#SwipeToReveal(kotlin.Function1,kotlin.Function0,androidx.wear.compose.material3.SurfaceTransformation,androidx.compose.ui.Modifier,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.compose.material3.RevealState,androidx.wear.compose.material3.RevealDirection,kotlin.Boolean,androidx.wear.compose.foundation.GestureInclusion,androidx.compose.ui.unit.Dp,kotlin.Function0)` should handle gestures. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToRevealDefaults#ActionContentSpacing()` The default space between actions and content. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToRevealDefaults#LargeActionButtonHeight()` Standard height for a large revealed action, such as when the swiped item is a Card. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToRevealDefaults#LeftEdgeZoneFraction()` The default value used to configure the size of the left edge zone in a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToReveal.composable#SwipeToReveal(kotlin.Function1,kotlin.Function0,androidx.wear.compose.material3.SurfaceTransformation,androidx.compose.ui.Modifier,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.compose.material3.RevealState,androidx.wear.compose.material3.RevealDirection,kotlin.Boolean,androidx.wear.compose.foundation.GestureInclusion,androidx.compose.ui.unit.Dp,kotlin.Function0)`. |
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/GestureInclusion` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToRevealDefaults#bidirectionalGestureInclusion()` A behaviour for `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToReveal.composable#SwipeToReveal(kotlin.Function1,kotlin.Function0,androidx.wear.compose.material3.SurfaceTransformation,androidx.compose.ui.Modifier,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.compose.material3.RevealState,androidx.wear.compose.material3.RevealDirection,kotlin.Boolean,androidx.wear.compose.foundation.GestureInclusion,androidx.compose.ui.unit.Dp,kotlin.Function0)` to handle all gestures, intended for rare cases where `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RevealDirection#Bidirectional()` is used and no swipe events are ignored. |

## Public functions

### flingBehavior

Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.7.0)

```
@Composable
fun flingBehavior(revealState: RevealState): TargetedFlingBehavior
```

Creates and remembers the default fling behavior used by the SwipeToReveal component.

This specialized behavior handles the physics of the swipe gesture, ensuring compliance with Wear Compose Material 3 UX guidelines.

This should be used when building custom gesture modifiers (like nested scrolling) that need to perform a fling on a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RevealState` while maintaining the exact feel of the native component.

| Parameters |
|---|---|
| `revealState: https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RevealState` | The `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RevealState` associated with the component. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` | A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/TargetedFlingBehavior` configured for SwipeToReveal gestures. |

### gestureInclusion

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
fun gestureInclusion(
    state: RevealState,
    edgeZoneFraction: @FloatRange(from = 0.0, to = 1.0) Float = LeftEdgeZoneFraction
): GestureInclusion
```

The default behaviour for when `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToReveal.composable#SwipeToReveal(kotlin.Function1,kotlin.Function0,androidx.wear.compose.material3.SurfaceTransformation,androidx.compose.ui.Modifier,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.compose.material3.RevealState,androidx.wear.compose.material3.RevealDirection,kotlin.Boolean,androidx.wear.compose.foundation.GestureInclusion,androidx.compose.ui.unit.Dp,kotlin.Function0)` should handle gestures. In this implementation of `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/GestureInclusion`, swipe events that originate in the left edge of the screen (as determined by `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToRevealDefaults#LeftEdgeZoneFraction()`) will be ignored, if the `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RevealState` is `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RevealValue#Covered()`. This allows swipe-to-dismiss handlers (if present) to handle the gesture in this region.

| Parameters |
|---|---|
| `state: https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RevealState` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RevealState` of the `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToReveal.composable#SwipeToReveal(kotlin.Function1,kotlin.Function0,androidx.wear.compose.material3.SurfaceTransformation,androidx.compose.ui.Modifier,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.compose.material3.RevealState,androidx.wear.compose.material3.RevealDirection,kotlin.Boolean,androidx.wear.compose.foundation.GestureInclusion,androidx.compose.ui.unit.Dp,kotlin.Function0)`. |
| `edgeZoneFraction: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = LeftEdgeZoneFraction` | The fraction of the screen width from the left edge where gestures should be ignored. Defaults to `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToRevealDefaults#LeftEdgeZoneFraction()`. |

## Public properties

### ActionContentSpacing

```
val ActionContentSpacing: Dp
```

The default space between actions and content.

### LargeActionButtonHeight

```
val LargeActionButtonHeight: Dp
```

Standard height for a large revealed action, such as when the swiped item is a Card.

### LeftEdgeZoneFraction

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val LeftEdgeZoneFraction: Float
```

The default value used to configure the size of the left edge zone in a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToReveal.composable#SwipeToReveal(kotlin.Function1,kotlin.Function0,androidx.wear.compose.material3.SurfaceTransformation,androidx.compose.ui.Modifier,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.compose.material3.RevealState,androidx.wear.compose.material3.RevealDirection,kotlin.Boolean,androidx.wear.compose.foundation.GestureInclusion,androidx.compose.ui.unit.Dp,kotlin.Function0)`. The left edge zone in this case refers to the leftmost edge of the screen, in this region it is common to disable scrolling in order for swipe-to-dismiss handlers to take over.

### bidirectionalGestureInclusion

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val bidirectionalGestureInclusion: GestureInclusion
```

A behaviour for `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/SwipeToReveal.composable#SwipeToReveal(kotlin.Function1,kotlin.Function0,androidx.wear.compose.material3.SurfaceTransformation,androidx.compose.ui.Modifier,kotlin.Function1,kotlin.Function1,kotlin.Function1,androidx.wear.compose.material3.RevealState,androidx.wear.compose.material3.RevealDirection,kotlin.Boolean,androidx.wear.compose.foundation.GestureInclusion,androidx.compose.ui.unit.Dp,kotlin.Function0)` to handle all gestures, intended for rare cases where `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/RevealDirection#Bidirectional()` is used and no swipe events are ignored.