animation

Implements React Native Reanimated animations using project spring configs and UI-thread worklets.

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/homeslands/trend-ui --skill animation-homeslands
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: animation
Source: https://github.com/homeslands/trend-ui/tree/main/app/order-ui/src/.claude/skills/animation
Command: npx skills add https://github.com/homeslands/trend-ui --skill animation-homeslands

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires react-native-reanimated.

What problem does it solve? It prevents inconsistent, hardcoded animation values and frame drops in a React Native app by enforcing shared spring configs, UI-thread worklets, and deferred heavy work during navigation transitions. ## Core Features & Use Cases - Standardized Spring Physics: All damping, stiffness, and mass values come from SPRING_CONFIGS and MOTION in constants/motion.ts, covering press feedback, modals, pagination dots, popovers, and parallax. - Navigation Transition Patterns: Provides push/pop transition specs, parallax effects via MasterTransitionProvider, and shared element transitions for product images between list and detail screens. - Performance Guardrails: Queues heavy store updates, storage writes, and analytics through scheduleTransitionTask so they run after transitions complete instead of blocking the JS thread. - Use Case: When adding tap feedback to a new button, import SPRING_CONFIGS.press and MOTION.pressScale with useSharedValue and withSpring instead of hardcoding spring values. ## Quick Start Ask the AI to add a press scale animation to a Pressable component using the project's spring configs from constants/motion.ts.

Frequently Asked Questions about animation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add press scale animation to a Pressable in React Native?▼

Use useSharedValue with withSpring inside onPressIn and onPressOut handlers, applying the value through useAnimatedStyle. Import SPRING_CONFIGS.press and MOTION.pressScale (0.97) from constants/motion.ts rather than hardcoding damping or stiffness values.

What spring config should I use for modals and bottom sheets?▼

Use SPRING_CONFIGS.modal (damping 30, stiffness 380, mass 0.6) for custom sheet implementations. Note that @gorhom/bottom-sheet manages its own spring internally, so only apply this config to custom-built sheets.

Should I use Animated from react-native or react-native-reanimated?▼

Always use Animated from react-native-reanimated so animations run on the UI thread. The Animated API from react-native runs on the JS thread and is listed as an anti-pattern in this project.

Why do navigation transitions drop frames when updating stores?▼

Heavy Zustand updates, AsyncStorage writes, or analytics calls during router.push block the JS thread mid-animation. Wrap them in scheduleTransitionTask so they execute about 100ms after the transition completes.

When should measure() be called for shared element transitions?▼

Call measure() only inside onPressIn callbacks, never during render or onPress. Capturing layout in onPress is too late because navigation has already started, and measuring in render causes errors.

Can I call JavaScript functions inside useAnimatedStyle?▼

No, useAnimatedStyle worklets run on the UI thread and cannot call JS functions like store actions or console.log. If bridging is unavoidable, use runOnJS sparingly, batch updates, and add a comment explaining why it is needed.