Skip to content

Chip Counter Badge

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

Tags & Chips InputHTMLCSSany framework

Copy into your project

HTML
<div class="nuda-chip-count">
  <button type="button" class="nuda-chip-count__chip">
    Inbox
    <span class="nuda-chip-count__badge">12</span>
  </button>
  <button type="button" class="nuda-chip-count__chip">
    Mentions
    <span class="nuda-chip-count__badge nuda-chip-count__badge--accent">3</span>
  </button>
  <button type="button" class="nuda-chip-count__chip">
    Drafts
    <span class="nuda-chip-count__badge">0</span>
  </button>
  <button type="button" class="nuda-chip-count__chip">
    Archive
    <span class="nuda-chip-count__badge">99+</span>
  </button>
</div>
CSS
/* Chip Counter Badge
   Trailing numeric badge inside a chip — use --accent for emphasis.
   Customize: --count-accent */

.nuda-chip-count {
  --count-accent: #e4ff54;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nuda-chip-count__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 12px;
  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;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}

.nuda-chip-count__chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
}

.nuda-chip-count__badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  font: 700 10px/1 ui-sans-serif, system-ui, sans-serif;
  color: #fafafa;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
}

.nuda-chip-count__badge--accent {
  color: #09090b;
  background: var(--count-accent);
}

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

How to use Chip Counter Badge

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