---
title: "ThresholdConfig"
description: "Interface to compute a threshold between two anchors/states in a [swipeable].

To define a [ThresholdConfig], consider using [FixedThreshold] and [FractionalThreshold]."
type: "interface"
---

<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


> **Deprecated** SwipeableDeprecation


```kotlin
@ExperimentalMaterialApi
interface ThresholdConfig
```


Interface to compute a threshold between two anchors/states in a `swipeable`.

To define a `ThresholdConfig`, consider using `FixedThreshold` and `FractionalThreshold`.


## Functions

```kotlin
fun Density.computeThreshold(fromValue: Float, toValue: Float): Float
```


Compute the value of the threshold (in pixels), once the values of the anchors are known.



