Create stateful components with Lottie animations
This feature will give dynamism to your components and will enhance the quality of your app! Now you can easily set states by using dotLottie and Lottie animations instead of regular states.
Where to add the tags: A rectangle layer
These are the tags you can use in the design file to implement the toggle component.
These tags support only URLs ending in .json
Available use cases:
Menu icons in tab menu
Checkbox in forms
In contrast to the stateful components created with variants, remote actions can't be bound to each of the component states. Therefore, features like favorites/like buttons aren't supported with Lottie animations at the moment.
Add a custom frame to the tag that defines where the active animation is.
It's the frame where the animation changes. Setting a custom frame, sets the active animation from 0 to <
custom-frame>, and the default animation from
<custom-frame>to end. If no frame is specified, the animation will go from 0 to end.
In this example: The Lottie animation frame goes from 0 to 180. We will set a
<custom-frame>of 90 as it's where we want the animation to stop.
The animation plays as follows: To enable, on tap, the animation plays from 0 to 90, To disable, on tap, the animation plays from 90 to end.
Check our LottieFile guide to see how to add Lottie URLs.
Duplicate the files below to see how to set it up!