SwiftUI spring animations

32 examples. Spring animations built with SwiftUI. Physics-based motion with bounce and follow-through: squishy buttons, flung cards and elastic menus.

SwiftUI spring animations: common questions

How do I build spring animations in SwiftUI?
Pick an example below, copy its prompt (or send it to Claude Code, Cursor or Codex) and your agent builds it in SwiftUI. Each prompt lists the layout, timing and easing, and links a keyframe sheet of the motion. Use withAnimation with a spring, for example .spring(response: 0.35, dampingFraction: 0.8), for most state changes. Reach for matchedGeometryEffect when an element moves between views, PhaseAnimator or KeyframeAnimator for multi-step sequences, and contentTransition(.numericText()) for changing numbers.
What spring values should I use?
A good default is response 0.35–0.5 s with damping 0.7–0.85. Lower damping adds bounce; use it for playful moments, not everywhere.
Why use springs instead of easing curves?
Springs keep momentum when interrupted, so gestures and repeated taps feel natural.

Spring animations in other frameworks

More SwiftUI animations