code/core/animations-motion/README.md
Motion animation driver for Tamagui, powered by the Motion library and the Web Animations API (WAAPI).
damping, stiffness, and mass parametersx, y, scale, rotate properties separately with different configurationsyarn add @tamagui/animations-motion motion
Add to your Tamagui configuration:
import { createAnimations } from '@tamagui/animations-motion'
import { createTamagui } from 'tamagui'
export default createTamagui({
animations: createAnimations({
bouncy: {
type: 'spring',
damping: 9,
mass: 0.9,
stiffness: 150,
},
quick: {
type: 'spring',
damping: 20,
mass: 1.2,
stiffness: 250,
},
'100ms': {
duration: 100,
},
}),
// ...
})
{
type: 'spring',
damping: 10, // Higher = less bouncy
stiffness: 100, // Higher = faster
mass: 1, // Higher = more inertia
}
{
duration: 200, // Duration in milliseconds
}
For complete documentation, see the Tamagui Animations docs.