Spring

Tune a physical spring response with stiffness, damping, mass, and initial velocity.

Preview

A simulated oscillator approaches a target according to stiffness, damping, mass, and current velocity.

Preview

Implement Spring: Tune a physical spring response with stiffness, damping, mass, and initial velocity. Use Stiffness 220, Damping 24, Mass 1x, Initial velocity 0, Distance 48px. Trigger it once when state changes and keep it replayable. Use semantic HTML, scope CSS to .motion-demo--spring, and mount the provided vanilla JavaScript interaction runtime. Provide equivalent low-motion behavior for prefers-reduced-motion and .force-reduced-motion.

Learn more