DampingRatio

value class DampingRatio(val value: Float)

Represents the damping ratio of a spring animation.

The damping ratio describes how the spring's oscillation decays over time:

  • Under-damped (< 1.0): The spring overshoots and oscillates before settling. Lower values produce more bounce.

  • Critically damped (= 1.0): The spring returns to rest in the shortest time without overshooting.

  • Over-damped (> 1.0): The spring returns to rest without overshooting, but slower than critically damped.

  • Undamped (= 0.0): The spring oscillates forever without settling.

spring<Float>(dampingRatio = DampingRatio.MediumBouncy)
spring<Float>(dampingRatio = DampingRatio(0.6f))

Parameters

value

The damping ratio value. Must be non-negative.

Constructors

Link copied to clipboard
constructor(value: Float)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard