Skip to content

Notification Badge Nav

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

Sidebars & DocksHTMLCSSany framework

Copy into your project

HTML
<nav aria-label="Main" class="nuda-sb2-badge-nav">
  <ul class="nuda-sb2-badge-nav__list">
    <li>
      <a href="#" class="nuda-sb2-badge-nav__item" aria-current="page">
        <span class="nuda-sb2-badge-nav__icon" aria-hidden="true">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
               stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
            <path d="M3 11l9-8 9 8v10a2 2 0 01-2 2h-4v-7H9v7H5a2 2 0 01-2-2V11z" />
          </svg>
        </span>
        <span class="nuda-sb2-badge-nav__text">Home</span>
      </a>
    </li>
    <li>
      <a href="#" class="nuda-sb2-badge-nav__item">
        <span class="nuda-sb2-badge-nav__icon" aria-hidden="true">…</span>
        <span class="nuda-sb2-badge-nav__text">Messages</span>
        <span class="nuda-sb2-badge-nav__badge">3<span class="nuda-sb2-badge-nav__sr"> unread</span></span>
      </a>
    </li>
  </ul>
</nav>
CSS
.nuda-sb2-badge-nav {
  width: 180px;
  padding: 8px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
}

.nuda-sb2-badge-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nuda-sb2-badge-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  min-height: 36px;
  border-radius: 9px;
  color: #a0a0a8;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: background .2s,color .2s;
}

.nuda-sb2-badge-nav__item:hover {
  background: rgba(255,255,255,.05);
  color: #fafafa;
}

.nuda-sb2-badge-nav__item[aria-current="page"] {
  color: #e4ff54;
  background: rgba(228,255,84,.08);
}

.nuda-sb2-badge-nav__item:focus-visible {
  outline: 2px solid #e4ff54;
  outline-offset: 2px;
}

.nuda-sb2-badge-nav__icon svg {
  width: 16px;
  height: 16px;
}

.nuda-sb2-badge-nav__text {
  flex: 1;
}

.nuda-sb2-badge-nav__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e4ff54;
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
  animation: _nuda-sb2badgeNavPop .5s cubic-bezier(.34,1.56,.64,1) both;
}

.nuda-sb2-badge-nav__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@keyframes _nuda-sb2badgeNavPop {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-sb2-badge-nav__badge {
    animation: none;
  }
}

How to use Notification Badge Nav

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 sidebars & docks components

← Browse all NudaUI components