Skip to content

Play/Pause/Stop Morph

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

Morphing ShapesHTMLCSSany framework

Copy into your project

HTML
<!-- Play/Pause/Stop Morph — clip-path: path() cycles the icon shape -->
<div class="nuda-ms2-play-pause" role="img" aria-label="Icon looping between play, pause and stop">
  <span class="nuda-ms2-play-pause__icon" aria-hidden="true"></span>
</div>
CSS
.nuda-ms2-play-pause {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  background: #161616;
  border-radius: 12px;
}

.nuda-ms2-play-pause__icon {
  width: 56px;
  height: 56px;
  background: #e4ff54;
  animation: _nuda-ms2PlayPause 6s ease-in-out infinite;
  will-change: clip-path;
}

@keyframes _nuda-ms2PlayPause {
  0%,16% {
    clip-path: path("M14 8 L14 48 L46 28 Z");
  }
  33%,49% {
    clip-path: path("M14 8 L24 8 L24 48 L14 48 Z M32 8 L42 8 L42 48 L32 48 Z");
  }
  66%,82% {
    clip-path: path("M14 14 L42 14 L42 42 L14 42 Z");
  }
  100% {
    clip-path: path("M14 8 L14 48 L46 28 Z");
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-ms2-play-pause__icon {
    animation: none;
    clip-path: path("M14 8 L14 48 L46 28 Z");
  }
}

How to use Play/Pause/Stop Morph

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 morphing shapes components

← Browse all NudaUI components