Skip to content

Chip With Avatar

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

Tags & Chips InputHTMLCSSany framework
NU@nudaAL@ana.leeMK@marco.k

Copy into your project

HTML
<div class="nuda-chip-avatar">
  <span class="nuda-chip-avatar__chip">
    <span class="nuda-chip-avatar__img"
          style="background:linear-gradient(135deg,#e4ff54,#86efac)">NU</span>
    @nuda
    <button class="nuda-chip-avatar__x" aria-label="Remove">×</button>
  </span>
  <span class="nuda-chip-avatar__chip">
    <span class="nuda-chip-avatar__img"
          style="background:linear-gradient(135deg,#c4b5fd,#f9a8d4)">AL</span>
    @ana.lee
    <button class="nuda-chip-avatar__x" aria-label="Remove">×</button>
  </span>
</div>
CSS
/* Chip With Avatar
   Mention-style chip with a leading avatar circle.
   Customize: avatar gradient inline or per-variant */

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

.nuda-chip-avatar__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 3px;
  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;
  transition: border-color 0.2s;
}

.nuda-chip-avatar__chip:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.nuda-chip-avatar__img {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font: 700 9px/1 ui-sans-serif, system-ui, sans-serif;
  color: #09090b;
  border-radius: 99px;
  letter-spacing: 0.02em;
}

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

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

@media (prefers-reduced-motion: reduce) {
  .nuda-chip-avatar__chip { transition: none; }
}

How to use Chip With Avatar

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