$ git show tooltip

Tooltip

Intermediate/anim tooltip

A small bubble with an arrow springs out of the element it points at, then shrinks back into it.

Main · New Architecture only · worklets live in react-native-worklets
transitionPropertytransformOrigincubicBezier
tooltip.tsx · reanimated 4
// Reanimated 4: opacity and transform transitions, an overshoot curve on the way in
<View style={{ alignItems: 'center' }}>
  <Animated.View
    pointerEvents="none"
    style={[styles.tooltip, {
      transformOrigin: 'bottom',
      opacity: visible ? 1 : 0,
      transform: [{ translateY: visible ? 0 : 6 }, { scale: visible ? 1 : 0.6 }],
      transitionProperty: ['opacity', 'transform'],
      transitionDuration: visible ? '260ms' : '120ms',
      transitionTimingFunction: visible ? cubicBezier(0.3, 1.5, 0.5, 1) : 'ease-in',
    }]}>
    <Text style={styles.tooltipText}>Saved to library</Text>
    <View style={styles.arrow} />
  </Animated.View>
  <Pressable onLongPress={() => setVisible(true)} onPressOut={() => setVisible(false)}>
    <BookmarkIcon />
  </Pressable>
</View>