Choose an animation API

The following diagram helps you decide what API to use to implement your animation.

Flowchart describing the decision tree for choosing the appropriate animation API
Figure 1. Decision tree describing how to choose the appropriate animation API.

Flowchart describing the decision tree for choosing the appropriate animation API

Use the following decision tree to choose the most appropriate animation API for your use case:

  • Is your animation art-based (that is, SVGs or images)?
    • Yes: Does it use simple SVGs (that is, an icon with micro-animations)?
    • No: Does the animation need to repeat infinitely?
      • Yes: rememberInfiniteTransition.
      • No: Are you animating a layout?
        • Yes: Are you switching between composables with different content?
        • No: Are you animating multiple properties?
          • Yes: Are the properties completely independent of each other?
          • No: Does the animation have predefined target values?
            • Yes: animate*AsState. For Text, use TextMotion.Animated.
            • No: Is the animation gesture-driven and the single source of truth?

Download the PDF version of the diagram.