# SpringSpec

Artifact: [androidx.compose.animation:animation-core](https://developer.android.com/jetpack/androidx/releases/compose-animation) [View Source](https://cs.android.com/search?q=file:androidx/compose/animation/core/AnimationSpec.kt+class:androidx.compose.animation.core.SpringSpec) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.0.0) Common/All
- Cmn

  ```
  class SpringSpec<T : Any?> : FiniteAnimationSpec<T>
  ```

*** ** * ** ***

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec` that uses the given spring constants (i.e. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#(kotlin.Float,kotlin.Float,kotlin.Any)` and `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#(kotlin.Float,kotlin.Float,kotlin.Any)`. The optional `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#(kotlin.Float,kotlin.Float,kotlin.Any)` defines when the animation should be considered to be visually close enough to round off to its target.

## Summary

| ### Public constructors |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#SpringSpec(kotlin.Float,kotlin.Float,kotlin.Any)( dampingRatio: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, stiffness: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, visibilityThreshold: T? )` | Cmn |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#hashCode()()` | Cmn |
| `open https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedSpringSpec<V>` | `<V : https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector> https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#vectorize(androidx.compose.animation.core.TwoWayConverter)(converter: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter<T, V>)` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec` with the given `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter`. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#dampingRatio()` damping ratio of the spring. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#stiffness()` stiffness of the spring. | Cmn |
| `T?` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec#visibilityThreshold()` specifies the visibility threshold | Cmn |

## Public constructors

### SpringSpec

Cmn

```
<T : Any?> SpringSpec(
    dampingRatio: Float = Spring.DampingRatioNoBouncy,
    stiffness: Float = Spring.StiffnessMedium,
    visibilityThreshold: T? = null
)
```

| Parameters |
|---|---|
| `dampingRatio: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Spring.DampingRatioNoBouncy` | damping ratio of the spring. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Spring#DampingRatioNoBouncy()` by default. |
| `stiffness: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Spring.StiffnessMedium` | stiffness of the spring. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Spring#StiffnessMedium()` by default. |
| `visibilityThreshold: T? = null` | specifies the visibility threshold |

## Public functions

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### vectorize

Cmn

```
open fun <V : AnimationVector> vectorize(converter: TwoWayConverter<T, V>): VectorizedSpringSpec<V>
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec` with the given `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter`.

The underlying animation system operates on `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector`s. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec` will be converted to `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector` to animate. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/VectorizedAnimationSpec` describes how the converted `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector` should be animated. E.g. The animation could simply interpolate between the start and end values (i.e.`https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TweenSpec`), or apply spring physics to produce the motion (i.e. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/SpringSpec`), etc)

| Parameters |
|---|---|
| `converter: https://developer.android.com/reference/kotlin/androidx/compose/animation/core/TwoWayConverter<T, V>` | converts the type `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationSpec` from and to `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/AnimationVector` type |

## Public properties

### dampingRatio

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

```
val dampingRatio: Float
```

damping ratio of the spring. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Spring#DampingRatioNoBouncy()` by default.

### stiffness

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

```
val stiffness: Float
```

stiffness of the spring. `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Spring#StiffnessMedium()` by default.

### visibilityThreshold

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

```
val visibilityThreshold: T?
```

specifies the visibility threshold