to
Animates to a specified value from the current target value.
Must be defined inside a local tween parameter Object
.
Required
Only if no from property is defined
Accepts
- Any valid Tween value types
- An
Array
of two Tween value keyframes ([fromValue, toValue]
)
Default
The current target value is used if only a from property is defined
to code example
import { animate } from 'animejs';
animate('.square', {
x: {
to: '16rem', // From 0px to 16rem
ease: 'outCubic',
},
rotate: {
to: '.75turn', // From 0turn to .75turn
ease: 'inOutQuad'
},
});
<div class="large row">
<div class="square"></div>
</div>