Search

2. Spring

Here’s another animation that starts automatically. This one has a spring curve.

⚡️ Some Examples – 02 – Spring
open in CodeSandbox
export function Example() {
    return (
        <motion.div
            style={{
                width: 150,
                height: 150,
                borderRadius: 30,
                backgroundColor: "#fff"
            }}
            animate={{ rotate: 180 }}
            transition={{
                type: "spring",
                damping: 10,
                mass: 0.75,
                stiffness: 100
            }}
        />
    );
}

Leave a Reply

plugins premium WordPress
Scroll to Top