Morphing Square
A copy-paste loaders component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
LoadersHTMLCSSany framework
Copy into your project
HTML
<!-- Morphing Square Loader -->
<div class="nuda-morphing-square" role="status" aria-label="Loading">
<div class="nuda-morphing-square__shape"></div>
</div>CSS
/* Morphing Square Loader
Square morphs through round/diamond shapes while rotating.
Customize: --msq-color, --msq-size */
.nuda-morphing-square {
--msq-color: #e4ff54;
--msq-size: 32px;
padding: 8px;
display: flex;
align-items: center;
justify-content: center;
}
.nuda-morphing-square__shape {
width: var(--msq-size);
height: var(--msq-size);
background: var(--msq-color);
animation: nuda-morphing-square 2.4s ease-in-out infinite;
will-change: transform, border-radius;
}
@keyframes nuda-morphing-square {
0% { border-radius: 2px; transform: rotate(0deg); }
25% { border-radius: 50%; transform: rotate(90deg); }
50% { border-radius: 2px; transform: rotate(180deg); }
75% { border-radius: 50% 2px 50% 2px; transform: rotate(270deg); }
100% { border-radius: 2px; transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
.nuda-morphing-square__shape { animation: none; border-radius: 6px; }
}How to use Morphing Square
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.