Index of every page on this site: llms.txt
All skills
Run it yourself

Production animation patterns for React Native using Reanimated 4, Skia, WebGPU, and TypeGPU. Covers CSS transitions, CSS animations, CSS pseudo-selectors, CSS callbacks, shared value animations, canvas animations with react-native-skia, GPU shader animations, layout animations, scroll-driven animations, particle systems, procedural noise, SDF rendering, performance tuning, and accessibility. Trigger on: Reanimated, useSharedValue, useAnimatedStyle, withSpring, withTiming, withDecay, withRepeat, withSequence, CSS transition, CSS animation, layout animation, FadeIn, SlideIn, ZoomIn, LinearTransition, keyframe, interpolate, scrollTo, useFrameCallback, react-native-skia, Skia Canvas, Atlas, usePathInterpolation, usePathValue, useClock, useTexture, SKSL, interpolateColors, Picture API, canvas animation, sprite animation, WebGPU, react-native-wgpu, TypeGPU, GPU shader, WGSL, particle system, Perlin noise, SDF, Three.js, react-three-fiber, animation performance, or any request to animate UI in React Native.

Use this Skill: https://skilld.dev/gh/software-mansion-labs/skills/animations

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

layout-animations.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Layout Animations

Animations for components entering, exiting, or changing position in the view hierarchy. Reanimated 4, New Architecture required.

For predefined animation lists, modifiers, and parameters, webfetch the linked documentation pages below.


Entering and Exiting Animations

Animate elements when they are added to or removed from the view hierarchy:

import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';

{visible && (
  <Animated.View entering={FadeIn} exiting={FadeOut}>
    <Text>Hello</Text>
  </Animated.View>
)}

Predefined animation families include Fade, Slide, Zoom, Bounce, Flip, Stretch, Roll, Rotate, LightSpeed, and Pinwheel. Each has directional variants (e.g., FadeInRight, FadeInLeft, FadeInUp, FadeInDown).

Chain modifiers on any predefined animation:

entering={FadeIn.duration(500).delay(200).springify().damping(15)}

Time-based modifiers (.duration(), .easing()) are incompatible with spring-based modifiers (.springify(), .damping(), .mass(), .stiffness()).

Gotchas

  • nativeID conflict (New Architecture): Reanimated uses nativeID internally for entering animations. Overwriting it breaks the animation. Wrap animated children in a plain View to work around this, especially with TouchableWithoutFeedback.
  • View flattening: Removing a non-animated parent triggers exiting animations in its children, but the parent will not wait for children to finish. Add collapsable={false} to the parent to prevent this.
  • Spring-based animations: Not yet available on the web platform.
  • Performance: Define animation builders outside of components or wrap with useMemo.

Layout Transitions

Smooth animations when a component's position or size changes due to state updates:

import Animated, { LinearTransition } from 'react-native-reanimated';

<Animated.View layout={LinearTransition}>
  {items.map((item) => (
    <Item key={item.id} {...item} />
  ))}
</Animated.View>

Predefined transitions: LinearTransition, SequencedTransition, FadingTransition, JumpingTransition, CurvedTransition, EntryExitTransition.

The generic Layout transition from older Reanimated versions is deprecated. Use LinearTransition.

Spring config modes: Use either physics-based (damping/stiffness) or duration-based (duration/dampingRatio), never both. If both are provided, duration-based overrides.


Keyframe Animations

For complex multi-step entering/exiting animations beyond what presets offer:

import { Keyframe } from 'react-native-reanimated';

const enteringAnimation = new Keyframe({
  0: { opacity: 0, transform: [{ scale: 0.5 }, { rotate: '-45deg' }] },
  50: {
    opacity: 1,
    transform: [{ scale: 1.2 }, { rotate: '0deg' }],
    easing: Easing.out(Easing.quad),
  },
  100: { transform: [{ scale: 1 }, { rotate: '0deg' }] },
});

<Animated.View entering={enteringAnimation.duration(600)} />

Rules

  • Keyframe 0 (or from) is required. Provide initial values for all properties you intend to animate.
  • Keyframe 100 (or to) is optional.
  • Do not provide both 0 and from, or both 100 and to.
  • Easing is assigned to the second keyframe in a pair. Never provide easing to keyframe 0.
  • Default easing between keyframes is Easing.linear.
  • All properties in the transform array must appear in the same order across all keyframes.

List Layout Animations

Animate item layout changes in FlatList when items are added, removed, or reordered:

<Animated.FlatList
  data={data}
  renderItem={renderItem}
  itemLayoutAnimation={LinearTransition}
/>

Rules

  • Only works with single-column FlatList. numColumns cannot be greater than 1.
  • Items must have a key or id property (or provide a custom keyExtractor).
  • Set itemLayoutAnimation to undefined to disable at runtime.
  • Use .skipEnteringExitingAnimations to prevent entering/exiting animations on initial mount and unmount of the FlatList.

LayoutAnimationConfig

Skip entering/exiting animations for a subtree:

import { LayoutAnimationConfig } from 'react-native-reanimated';

<LayoutAnimationConfig skipEntering skipExiting>
  {children}
</LayoutAnimationConfig>

Can be nested. For FlatLists, use the .skipEnteringExitingAnimations modifier on itemLayoutAnimation instead.


Shared Element Transitions

Status: Experimental. Not recommended for production.

Animates a view between two screens during navigation:

<Animated.Image
  sharedTransitionTag="hero-image"
  sharedTransitionStyle={SharedTransition.duration(550).springify()}
/>
  • Requires React Navigation native stack navigator. Tab navigator and transparentModal (iOS) are not supported.
  • Tags must be unique per screen. Add the same tag to matching components on both screens.
  • Default duration: 500ms. Animates width, height, position, transform, backgroundColor, opacity.
  • iOS supports progress-based (swipe gesture) transitions. Android uses timing-based transitions only.
  • Custom animation functions are not yet supported.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides comprehensive documentation and production patterns for React Native animations using Reanimated 4, Skia, and WebGPU. It includes instructions for environment setup, package installation, and configuration for the New Architecture. All referenced resources, including Node.js packages and external documentation, belong to the vendor (Software Mansion) or established community libraries. No malicious patterns or security risks were identified.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: MEDIUM · 1 issue

Signed by skilld at 43cde80. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 2 months ago

README badge

README badge for software-mansion-labs/skills/animations