Skip to content

Line Bounce

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

LoadersHTMLCSSany framework

Copy into your project

HTML
<!-- Line Bounce Loader -->
<div class="nuda-line-bounce" role="status" aria-label="Loading">
  <div class="nuda-line-bounce__line"></div>
</div>
CSS
/* Line Bounce Loader
   A horizontal line bouncing between two endpoints.
   Customize: --line-track-width, --line-color, --line-track-color */

.nuda-line-bounce {
  --line-track-width: 60px;
  --line-color: #a78bfa;
  --line-track-color: rgba(255, 255, 255, 0.1);
  width: var(--line-track-width);
  height: 4px;
  background: var(--line-track-color);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.nuda-line-bounce__line {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 100%;
  background: var(--line-color);
  border-radius: 2px;
  animation: nuda-line-bounce 1.4s ease-in-out infinite;
  will-change: left;
}

@keyframes nuda-line-bounce {
  0%   { left: 0; }
  50%  { left: calc(100% - 20px); }
  100% { left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-line-bounce__line {
    animation: none;
    left: 0;
    opacity: 0.6;
  }
}

How to use Line Bounce

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