Skip to main content

spring and spring-response

Choose a velocity-preserving spring response.

Quick reference​

SyntaxBehavior
springDefault: response 280 ms, damping ratio 1, mass 1.
spring-fast200 ms, ratio 1, mass 1.
spring-soft400 ms, ratio 1, mass 1.
spring-bouncy320 ms, ratio 0.75, mass 1.
spring-response-NUndamped period: integer 100–2,000 ms.
spring-damping-ratio-NRelative damping: 0.1–2.
spring-stiffness-NRaw stiffness: 1–50,000.
spring-damping-NRaw damping coefficient: 0.1–2,000.
spring-mass-NMass: 0.1–10.

Example​

<View class="w-12 h-12 bg-accent transition-transform spring-response-240 spring-damping-ratio-1" />

Rules and validation​

Response is not a completion deadline. Smaller response means faster motion. Retargeting preserves value and velocity. Critical damping is the default but a retarget with momentum can pass its new target. Last preset/engine wins; explicit physical overrides apply to that preset independent of order. The last response/stiffness assignment controls frequency; the last damping-ratio/raw-damping assignment controls damping. Duration/easing on an effective spring, or spring settings on an effective tween, fail validation. Hosts may tighten numeric bounds.

Springs and interruption · All reference