Compose Animations
Chris Banes on Jetpack Compose motion: pick the smallest animation API that does the job.
$ npx skills add https://craftwork.design/skills/compose-animations -a claude-code -y
Installs into .claude/skills/compose-animations. Add -g for every project.
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. In a swap between distinct items, keep the target value as the identity (the default) or key by a stable item ID; do not collapse different items to a shared presence or branch key. In a review, name any rendered expression that captures outer target state and recommend using the lambda target there. If a test must prove transition identity, check outgoing and incoming content during the overlap; checking only the settled destination misses a shared-identity bug. Read AnimatedContent identity for state-holder details.
Files
3 files, 17 KBMore mobile & native
- Native-Feeling Mobile Web
Concrete CSS and meta fixes that make a web app feel native on phones: stuck hover, tap flash, dvh, input zoom, safe areas and overscroll.
Emil KowalskiMobile & native45.6K - Animate Expo
Animation decisions for React Native and Expo: Reanimated or Animated, springs, keeping motion off the JS thread, press states and haptics.
Emil KowalskiMobile & native45.6K