$ git show chip-select

Filter chips

Intermediate/anim chip-select

Tapping a chip fills it and grows a check mark, and the chips around it slide over to make room.

Main · New Architecture only · worklets live in react-native-worklets
LinearTransitionZoomIn / ZoomOuttransitionProperty
chip-select.tsx · reanimated 4
// Reanimated 4: layout animations still reflow the row; the chip colors use a CSS transition
import Animated, { LinearTransition, ZoomIn, ZoomOut } from 'react-native-reanimated';

const [selected, setSelected] = useState(new Set(['Vegan']));
const toggle = (tag) => setSelected((s) => {
  const next = new Set(s);
  next.has(tag) ? next.delete(tag) : next.add(tag);
  return next;
});

<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 8 }}>
  {TAGS.map((tag) => {
    const on = selected.has(tag);
    return (
      <Animated.View key={tag} layout={LinearTransition.springify().damping(18)}>
        <Pressable onPress={() => toggle(tag)}>
          <Animated.View style={[styles.chip, {
            backgroundColor: on ? '#2F54EB' : 'white',
            borderColor: on ? '#2F54EB' : '#DADFE6',
            transitionProperty: ['backgroundColor', 'borderColor'],
            transitionDuration: '180ms',
          }]}>
            {on && (
              <Animated.View entering={ZoomIn.springify()} exiting={ZoomOut.duration(120)}>
                <CheckIcon size={14} color="white" />
              </Animated.View>
            )}
            <Text style={[styles.chipText, on && { color: 'white' }]}>{tag}</Text>
          </Animated.View>
        </Pressable>
      </Animated.View>
    );
  })}
</View>