spring

Function

Common
public fun <T> spring(
    dampingRatio: Float = Spring.DampingRatioNoBouncy,
    stiffness: Float = Spring.StiffnessMedium,
    visibilityThreshold: T? = null,
): SpringSpec<T>

Creates a SpringSpec that uses the given spring constants (i.e. dampingRatio and stiffness. The optional visibilityThreshold defines when the animation should be considered to be visually close enough to round off to its target.

Parameters

dampingRatiodamping ratio of the spring. Spring.DampingRatioNoBouncy by default.
stiffnessstiffness of the spring. Spring.StiffnessMedium by default.
visibilityThresholdoptionally specifies the visibility threshold.