spring and spring-response
Choose a velocity-preserving spring response.
Quick reference
| Syntax | Behavior |
|---|---|
spring | Default: response 280 ms, damping ratio 1, mass 1. |
spring-fast | 200 ms, ratio 1, mass 1. |
spring-soft | 400 ms, ratio 1, mass 1. |
spring-bouncy | 320 ms, ratio 0.75, mass 1. |
spring-response-N | Undamped period: integer 100–2,000 ms. |
spring-damping-ratio-N | Relative damping: 0.1–2. |
spring-stiffness-N | Raw stiffness: 1–50,000. |
spring-damping-N | Raw damping coefficient: 0.1–2,000. |
spring-mass-N | Mass: 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.