compose-animations
Installation
SKILL.md
Compose: animations
Core principle
Pick the smallest API that expresses the motion and its lifecycle.
Procedure
- Identify the job: show or hide a subtree, animate one value, coordinate values from one state, resize content, swap content, or handle user-driven motion.
- Choose the matching API from the table. Prefer target-state APIs; use
Animatableonly when gestures, interruption, or imperative control require it. - Check lifecycle: an alpha animation keeps content composed;
AnimatedVisibilityremoves it after exit. Do not use a fade when unmounting is required. - For
AnimatedContent, render from the content lambda target and choose acontentKeyonly when visual identity differs from payload equality. Read AnimatedContent identity for state-holder details. - Keep animated
Statein layout or draw block modifiers when it changes at frame rate; route deeper diagnosis to Compose performance. - Use Navigation Compose transitions for destination swaps it owns, and dedicated libraries for art-based motion.
- Finish when the API, lifecycle, and content identity match the UI, no simpler API fits, and the relevant behavior is verified.