CSS Animation Example: Bouncing Dots

"Bouncing Dots" are a friendly, conversational loading indicator often used to show that another user is typing or a system is "thinking."

This effect combines a simple vertical translateY() transform keyframe with staggered animation-delays. By setting the animation direction to alternate, each dot naturally falls back down without needing complex keyframe steps.

Here is the code to create the Bouncing Dots animation.

View Output

Accessibility Considerations

As with the Infinite Spinner, we don't want to completely disable a loading indicator for users who prefer reduced motion, because they still need to know the system is loading.

Here, the prefers-reduced-motion media query swaps the kinetic bouncing animation for a gentle, slow-fading opacity pulse. We also increase the delays so the fade is subtle and not distracting.


@media (prefers-reduced-motion: reduce) {
    .dot {
        /* Swap bounce for a gentle fade */
        animation: pulse-fade 1.5s infinite alternate;
    }
    .dot:nth-child(2) { animation-delay: 0.5s; }
    .dot:nth-child(3) { animation-delay: 1.0s; }
}

@keyframes pulse-fade {
    to { opacity: 0.3; }
}