$ git show jelly-scroll

Jelly scroll

Advanced/anim jelly-scroll

List rows skew with scroll velocity and settle back with a spring, giving a wobbly feel.

Inspired by Jelly scrollFrom William Candillon’s “Can it be done in React Native?” series. The code here is a simplified rewrite for Reanimated 4 and 3.
Main · New Architecture only · worklets live in react-native-worklets

This snippet uses APIs that didn’t change between versions, so the same code runs on Reanimated 4 and 3.

useAnimatedScrollHandlervelocityskewY
jelly-scroll.tsx · reanimated 4
const velocity = useSharedValue(0), lastY = useSharedValue(0), lastT = useSharedValue(0);
const onScroll = useAnimatedScrollHandler({
  onScroll: e => {
    const now = Date.now(); // e.velocity is iOS only, so compute it
    velocity.value = (e.contentOffset.y - lastY.value) / Math.max(1, now - lastT.value);
    lastY.value = e.contentOffset.y; lastT.value = now;
  },
  onMomentumEnd: () => { velocity.value = 0; },
});
const skew = useDerivedValue(() => withSpring(clamp(velocity.value * 6, -12, 12), { damping: 8 }));
const row = useAnimatedStyle(() => ({ transform: [{ skewY: skew.value + 'deg' }] }));
// apply row style to every item (or to the content container)