# SwipeableDefaults

# SwipeableDefaults

Artifact:[androidx.compose.material:material](https://developer.android.com/jetpack/androidx/releases/compose-material)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/material/Swipeable.kt+class:androidx.compose.material.SwipeableDefaults)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)  
Deprecated in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.6.0)
Common/AllAndroid/JVM
  - Cmn  

  ```
  object SwipeableDefaults
  ```

*** ** * ** ***

| **This object is deprecated.**   
| Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs. Please see developer.android.com for an overview of the changes and a migration guide.

Contains useful defaults for[swipeable](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp))and[SwipeableState](https://developer.android.com/reference/kotlin/androidx/compose/material/SwipeableState).

## Summary

|                                      ### Constants                                      |
|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| `const `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [StandardResistanceFactor](https://developer.android.com/reference/kotlin/androidx/compose/material/SwipeableDefaults#StandardResistanceFactor())` = 10.0f` A standard resistance factor which indicates that the user has run out of things to see. | Cmn |
| `const `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [StiffResistanceFactor](https://developer.android.com/reference/kotlin/androidx/compose/material/SwipeableDefaults#StiffResistanceFactor())` = 20.0f` A stiff resistance factor which indicates that swiping isn't available right now.              | Cmn |

|                                               ### Public functions                                               |
|------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [ResistanceConfig](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig)`?` | [resistanceConfig](https://developer.android.com/reference/kotlin/androidx/compose/material/SwipeableDefaults#resistanceConfig(kotlin.collections.Set,kotlin.Float,kotlin.Float))`(` ` anchors: `[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`>,` ` factorAtMin: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` factorAtMax: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) `)` The default resistance config used by[swipeable](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)). | Cmn |

|                                                                                    ### Public properties                                                                                     |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [SpringSpec](https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec)`<`[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`>` | [AnimationSpec](https://developer.android.com/reference/kotlin/androidx/compose/material/SwipeableDefaults#AnimationSpec()) The default animation used by[SwipeableState](https://developer.android.com/reference/kotlin/androidx/compose/material/SwipeableState).                                                                                                                                                                                                                                                                                                                                                                                         | Cmn |
| [Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)                                                                                                             | [VelocityThreshold](https://developer.android.com/reference/kotlin/androidx/compose/material/SwipeableDefaults#VelocityThreshold()) The default velocity threshold (1.8 dp per millisecond) used by[swipeable](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)). | Cmn |

## Constants

### StandardResistanceFactor

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)  
Deprecated in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.6.0)  

```
const val StandardResistanceFactor = 10.0f: Float
```

A standard resistance factor which indicates that the user has run out of things to see.  

### StiffResistanceFactor

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)  
Deprecated in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.6.0)  

```
const val StiffResistanceFactor = 20.0f: Float
```

A stiff resistance factor which indicates that swiping isn't available right now.

## Public functions

### resistanceConfig

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)  
Deprecated in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.6.0)  

```
fun resistanceConfig(
    anchors: Set<Float>,
    factorAtMin: Float = StandardResistanceFactor,
    factorAtMax: Float = StandardResistanceFactor
): ResistanceConfig?
```

The default resistance config used by[swipeable](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)).

This returns`null`if there is one anchor. If there are at least two anchors, it returns a[ResistanceConfig](https://developer.android.com/reference/kotlin/androidx/compose/material/ResistanceConfig)with the resistance basis equal to the distance between the two bounds.

## Public properties

### AnimationSpec

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)  
Deprecated in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.6.0)  

```
val AnimationSpec: SpringSpec<Float>
```

The default animation used by[SwipeableState](https://developer.android.com/reference/kotlin/androidx/compose/material/SwipeableState).  

### VelocityThreshold

Cmn  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)  
Deprecated in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.6.0)  

```
val VelocityThreshold: Dp
```

The default velocity threshold (1.8 dp per millisecond) used by[swipeable](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)).