Shape Shifter
A copy-paste morphing shapes component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Morphing ShapesHTMLCSSany framework
Copy into your project
HTML
<!-- Shape Shifter Loader -->
<div class="nuda-morph-loader" role="status" aria-label="Loading">
<div class="nuda-morph-loader__shape"></div>
</div>CSS
/* Shape Shifter Loader
A single element cycling square -> circle -> triangle -> rounded square.
Customize: --morph-loader-size, --morph-loader-color */
.nuda-morph-loader {
--morph-loader-size: 48px;
--morph-loader-color: #e4ff54;
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
}
.nuda-morph-loader__shape {
width: var(--morph-loader-size);
height: var(--morph-loader-size);
background: var(--morph-loader-color);
animation: nuda-morph-loader-cycle 3s ease-in-out infinite;
will-change: border-radius, clip-path, transform;
}
@keyframes nuda-morph-loader-cycle {
0% { border-radius: 0; clip-path: none; transform: rotate(0deg); }
25% { border-radius: 50%; clip-path: none; transform: rotate(90deg); }
50% { border-radius: 0; clip-path: polygon(50% 0%, 100% 100%, 0% 100%); transform: rotate(180deg); }
75% { border-radius: 12px; clip-path: none; transform: rotate(270deg); }
100% { border-radius: 0; clip-path: none; transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
.nuda-morph-loader__shape {
animation: none;
border-radius: 12px;
}
}How to use Shape Shifter
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.