Stiffness

value class Stiffness(val value: Float)

Represents the stiffness of a spring animation.

Stiffness controls how quickly the spring responds to displacement. Higher stiffness means a stronger restoring force, resulting in faster animations with higher frequency oscillation.

Use the predefined constants for common values, or create custom stiffness with any positive float:

spring<Float>(stiffness = Stiffness.Medium)
spring<Float>(stiffness = Stiffness(500f))

Parameters

value

The stiffness value. Must be positive.

Constructors

Link copied to clipboard
constructor(value: Float)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard