Component Props
All moti
components have a few useful props:
animate
Magically animate any value passed herefrom
The initial animation styles when the component mountsexit
Unmount animation styles. This works the exact same asframer-motion
's exit prop, and requires wrapping your component withAnimatePresence
. The only difference is you importAnimatePresence
frommoti
.transition
Take full control over your animation configuration. You can set options for your entire animtation (such astype: 'timing'
), or set transition options per-style.state
If you're using theuseAnimationState
hook, you should pass the state it returns to this prop.onDidAnimate
Callback function called after finishing a given animation.- First argument is the style prop string (
opacity
,scale
, etc.) - The second argument is whether the animation
finished
or not (boolean)
- First argument is the style prop string (