Skip to content\n\n/* CSS */\n/* Chip Remove Animation\n Chip shrinks and fades when removed.\n Customize: --chip-bg, --chip-radius */\n\n.nuda-chip-remove {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.nuda-chip-remove__chip {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 4px 4px 10px;\n font: 500 12px/1 ui-sans-serif, system-ui, sans-serif;\n color: #fafafa;\n background: #111114;\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 99px;\n transform-origin: center;\n animation: nuda-chip-in 0.25s ease both;\n}\n\n.nuda-chip-remove__chip--leaving {\n animation: nuda-chip-out 0.3s ease forwards;\n}\n\n.nuda-chip-remove__x {\n display: inline-grid;\n place-items: center;\n width: 18px;\n height: 18px;\n font-size: 14px;\n line-height: 1;\n color: #a0a0a8;\n background: transparent;\n border: 0;\n border-radius: 99px;\n cursor: pointer;\n transition: background 0.15s, color 0.15s;\n}\n\n.nuda-chip-remove__x:hover {\n background: rgba(255, 255, 255, 0.08);\n color: #fafafa;\n}\n\n@keyframes nuda-chip-in {\n from { opacity: 0; transform: scale(0.6); }\n to { opacity: 1; transform: scale(1); }\n}\n\n@keyframes nuda-chip-out {\n to { opacity: 0; transform: scale(0.6); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .nuda-chip-remove__chip,\n .nuda-chip-remove__chip--leaving { animation: none; }\n}","license":"https://opensource.org/licenses/MIT","codeRepository":"https://github.com/sgomez-dev/nudaui","isPartOf":{"@id":"https://nudaui.dev/#software"},"isAccessibleForFree":true,"inLanguage":"en","author":{"@id":"https://nudaui.dev/#founder"},"creator":{"@id":"https://nudaui.dev/#founder"},"copyrightHolder":{"@id":"https://nudaui.dev/#founder"},"keywords":"Tags & Chips Input, Chip Remove Animation, copy paste, css animation, ui component, framework agnostic"},{"@type":"Person","@id":"https://nudaui.dev/#founder","name":"Santiago Gómez de la Torre Romero","givenName":"Santiago","familyName":"Gómez de la Torre Romero","url":"https://sgomez.dev","jobTitle":"Software Engineer","description":"Creator, owner, and maintainer of NudaUI.","sameAs":["https://sgomez.dev","https://blog.sgomez.dev","https://github.com/sgomez-dev","https://linkedin.com/in/sgomez-dev","https://www.npmjs.com/package/sgomez-cli"]}]}

Chip Remove Animation

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

Tags & Chips InputHTMLCSSany framework
designanimationmotion

Copy into your project

HTML
<div class="nuda-chip-remove">
  <span class="nuda-chip-remove__chip">
    design
    <button class="nuda-chip-remove__x" aria-label="Remove design">×</button>
  </span>
  <span class="nuda-chip-remove__chip">
    motion
    <button class="nuda-chip-remove__x" aria-label="Remove motion">×</button>
  </span>
</div>

<script>
  document.querySelectorAll(".nuda-chip-remove__x").forEach((btn) => {
    btn.addEventListener("click", () => {
      const chip = btn.closest(".nuda-chip-remove__chip");
      chip.classList.add("nuda-chip-remove__chip--leaving");
      chip.addEventListener("animationend", () => chip.remove(), { once: true });
    });
  });
</script>
CSS
/* Chip Remove Animation
   Chip shrinks and fades when removed.
   Customize: --chip-bg, --chip-radius */

.nuda-chip-remove {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nuda-chip-remove__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 10px;
  font: 500 12px/1 ui-sans-serif, system-ui, sans-serif;
  color: #fafafa;
  background: #111114;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  transform-origin: center;
  animation: nuda-chip-in 0.25s ease both;
}

.nuda-chip-remove__chip--leaving {
  animation: nuda-chip-out 0.3s ease forwards;
}

.nuda-chip-remove__x {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 14px;
  line-height: 1;
  color: #a0a0a8;
  background: transparent;
  border: 0;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nuda-chip-remove__x:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fafafa;
}

@keyframes nuda-chip-in {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes nuda-chip-out {
  to { opacity: 0; transform: scale(0.6); }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-chip-remove__chip,
  .nuda-chip-remove__chip--leaving { animation: none; }
}

How to use Chip Remove Animation

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 tags & chips input components

← Browse all NudaUI components