Choose an animation API

The diagram below 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

Follow the decision tree questions below to choose which animation API is most appropriate for your use case:

  • Is my animation more like art, consisting of many visual elements? i.e. SVGs or images
    • Yes: Does it have simple SVGs? i.e. an icon with micro-animations
    • No: Does it need to repeat forever?
      • Yes: rememberInfiniteTransition
      • No: Is this a layout animation?
        • Yes: Changing between multiple composables that have different content?
        • No: Do you need to animate multiple properties?
          • Yes: Are the properties completely independent of each other?
          • No: Does the animation have a set of predefined target values?
            • Yes: animate*AsState, for Text, use TextMotion.Animated
            • No: Gesture driven animation? Your animation is the only source of truth?

Download the PDF version of the diagram.