$ git show shimmer

Skeleton shimmer

Intermediate/anim shimmer

Loading placeholder with a highlight sweeping across.

Main · New Architecture only · worklets live in react-native-worklets
animationNametranslateX %LinearGradient
shimmer.tsx · reanimated 4
const sweep = {
  from: { transform: [{ translateX: '-100%' }] },
  to: { transform: [{ translateX: '200%' }] },
};

<View style={[styles.bone, { overflow: 'hidden' }]}>
  <Animated.View
    style={[StyleSheet.absoluteFill, {
      width: '50%',
      animationName: sweep,
      animationDuration: '1.2s',
      animationIterationCount: 'infinite',
      animationTimingFunction: 'linear',
    }]}>
    <LinearGradient colors={['transparent', 'rgba(255,255,255,0.5)', 'transparent']}
      start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }} style={StyleSheet.absoluteFill} />
  </Animated.View>
</View>