createSpring
createSpring returns a new MotionValue that follows its source with spring physics. Pass a
MotionValue to track it, or pass a number to create a writable spring you can drive with .set().
import { createMotionValue, createSpring, motion } from 'motion-solidjs'
const x = createMotionValue(0)
const springX = createSpring(x, { stiffness: 200, damping: 22 })
return <motion.div style={{ x: springX }} />
move pointer
Options
stiffness- spring stiffness (default 100)damping- damping coefficient (default 10)mass- particle mass (default 1)velocity- initial velocityrestSpeed,restDelta- stop conditionsbounce,duration- alternative parameterization