React Architecture Concept • Core Motion Model
Spring: Declarative Rigid Body & Harmonic Physics in React
Updated November 2026
Spring physics represents the fundamental difference between robotic, pre-baked web transitions and lifelike, interactive interfaces. Unlike static CSS cubic-bezier curves—which must run for a fixed duration regardless of user action—spring simulations dynamically adapt to current velocity, interruptions, and momentum. ExodeUI integrates the Rapier2D WebAssembly physics engine directly into React components. You gain true physical mass, variable tension, restitution, and damping that feel organic to human touch and gestures without mathematical guesswork.
Traditional React spring libraries (such as react-spring) run analytical harmonic equations in JavaScript. ExodeUI's runtime includes the Rapier 2D physics engine, so a file can combine springs with rigid bodies, collisions and constraints.
Runnable ExodeUI React Implementation
Production ReadyMount the ExodeUICanvas component and bind parameters declaratively without imperative lifecycle hooks:
import React, { useState } from 'react';
import { ExodeUICanvas } from 'exodeui';
export function HarmonicSpringCard() {
const [isHovered, setIsHovered] = useState(false);
return (
<div
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
className="card-surface"
>
<ExodeUICanvas
src="/https/www.exodeui.com/scenes/spring-card.json"
inputs={{
"isTensioned": isHovered,
"stiffness": 220,
"damping": 14,
"mass": 1.0
}}
/>
</div>
);
}Frequently Asked Questions about spring
What is the physical difference between stiffness and damping in a spring?
Stiffness defines the restorative tension pulling the object toward its equilibrium resting state, while damping simulates viscous friction that absorbs kinetic energy and prevents infinite bouncing.
Can ExodeUI spring animations be interrupted without visual snapping?
Yes. Because spring state is represented by instantaneous position and velocity vectors rather than elapsed time, redirection mid-flight preserves momentum.
Do ExodeUI springs work in SwiftUI and Flutter?
Yes. The spring settings live in the .exode file, and the SwiftUI and Flutter runtime packages play that file. ExodeUI does not convert them to withAnimation code.
Do I need ExodeUI for this?
No. You can build this in code with CSS or a library such as GSAP or Motion. ExodeUI is an option when you want to set it up visually and keep it in one file. We make ExodeUI.