$ git show typing-dots
Typing dots
Three dots bounce in sequence, like a chat typing indicator.
const bounce = {
'0%': { opacity: 0.4, transform: [{ translateY: 0 }] },
'30%': { opacity: 1, transform: [{ translateY: -6 }] },
'60%': { opacity: 0.4, transform: [{ translateY: 0 }] },
'100%': { opacity: 0.4, transform: [{ translateY: 0 }] },
};
<View style={styles.bubble}>
{[0, 1, 2].map(i => (
<Animated.View
key={i}
style={[styles.dot, {
animationName: bounce,
animationDuration: '1.1s',
animationIterationCount: 'infinite',
animationDelay: i * 150 + 'ms',
}]}
/>
))}
</View>