Skip to content

Cube Flip

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

LoadersHTMLCSSany framework

Copy into your project

HTML
<!-- Cube Flip Loader -->
<div class="nuda-cube-flip" role="status" aria-label="Loading">
  <div class="nuda-cube-flip__cube"></div>
</div>
CSS
/* Cube Flip Loader
   A 3D cube flipping on its axes.
   Customize: --cube-size, --cube-color */

.nuda-cube-flip {
  --cube-size: 32px;
  --cube-color: #f472b6;
  perspective: 200px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nuda-cube-flip__cube {
  width: var(--cube-size);
  height: var(--cube-size);
  background: var(--cube-color);
  border-radius: 4px;
  animation: nuda-cube-flip 1.8s ease-in-out infinite;
  will-change: transform;
}

@keyframes nuda-cube-flip {
  0%   { transform: rotateX(0deg)   rotateY(0deg); }
  25%  { transform: rotateX(180deg) rotateY(0deg); }
  50%  { transform: rotateX(180deg) rotateY(180deg); }
  75%  { transform: rotateX(0deg)   rotateY(180deg); }
  100% { transform: rotateX(0deg)   rotateY(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-cube-flip__cube {
    animation: none;
    opacity: 0.7;
  }
}

How to use Cube Flip

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