Skip to content

Bouncing Ball

A copy-paste loaders component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

LoadersHTMLCSSany framework

Copy into your project

HTML
<!-- Bouncing Ball Loader -->
<div class="nuda-bouncing-ball" role="status" aria-label="Loading">
  <div class="nuda-bouncing-ball__ball"></div>
  <div class="nuda-bouncing-ball__shadow"></div>
</div>
CSS
/* Bouncing Ball Loader
   Ball bounces with squash/stretch on impact (transform only).
   Customize: --bball-color */

.nuda-bouncing-ball {
  --bball-color: #e4ff54;
  position: relative;
  width: 32px;
  height: 48px;
}

.nuda-bouncing-ball__ball {
  position: absolute;
  top: 0;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  background: var(--bball-color);
  border-radius: 50%;
  animation: nuda-bball 0.9s cubic-bezier(0.5, 0.05, 0.5, 0.95) infinite;
  will-change: transform;
}

.nuda-bouncing-ball__shadow {
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 18px;
  height: 5px;
  margin-left: -9px;
  background: rgba(228, 255, 84, 0.25);
  border-radius: 50%;
  filter: blur(1px);
  animation: nuda-bball-shadow 0.9s cubic-bezier(0.5, 0.05, 0.5, 0.95) infinite;
}

@keyframes nuda-bball {
  0%   { transform: translateY(0)    scaleY(1)   scaleX(1);   }
  45%  { transform: translateY(30px) scaleY(1)   scaleX(1);   }
  55%  { transform: translateY(30px) scaleY(0.7) scaleX(1.3); }
  65%  { transform: translateY(30px) scaleY(1)   scaleX(1);   }
  100% { transform: translateY(0)    scaleY(1)   scaleX(1);   }
}

@keyframes nuda-bball-shadow {
  0%, 100% { transform: scale(0.6); opacity: 0.3; }
  55%      { transform: scale(1.1); opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-bouncing-ball__ball,
  .nuda-bouncing-ball__shadow { animation: none; }
}

How to use Bouncing Ball

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More loaders components

← Browse all NudaUI components