Skip to content

Stacked Toast Group

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

Toasts & AlertsHTMLCSSany framework
Build deployed to production+2

Copy into your project

HTML
<div class="nuda-ta2-stack" role="status" aria-live="polite">
  <div class="nuda-ta2-stack__item nuda-ta2-stack__item--3" aria-hidden="true"></div>
  <div class="nuda-ta2-stack__item nuda-ta2-stack__item--2" aria-hidden="true"></div>
  <div class="nuda-ta2-stack__item nuda-ta2-stack__item--1">
    <span class="nuda-ta2-stack__text">Build deployed to production</span>
    <span class="nuda-ta2-stack__badge">+2</span>
  </div>
</div>
CSS
.nuda-ta2-stack {
  --c: #e4ff54;
  position: relative;
  width: 280px;
  height: 64px;
}

.nuda-ta2-stack__item {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #161616;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: .75rem .9rem;
  min-height: 44px;
  box-sizing: border-box;
  opacity: 0;
  transition: transform .25s ease;
}

.nuda-ta2-stack__item--1 {
  z-index: 3;
  transform: translateY(0) scale(1);
  animation: _nuda-ta2stackin1 .35s ease-out forwards .12s;
}

.nuda-ta2-stack__item--2 {
  z-index: 2;
  transform: translateY(8px) scale(.96);
  animation: _nuda-ta2stackin2 .35s ease-out forwards .06s;
}

.nuda-ta2-stack__item--3 {
  z-index: 1;
  transform: translateY(16px) scale(.92);
  animation: _nuda-ta2stackin3 .35s ease-out forwards 0s;
}

.nuda-ta2-stack:hover .nuda-ta2-stack__item--2 {
  transform: translateY(14px) scale(.96);
}

.nuda-ta2-stack:hover .nuda-ta2-stack__item--3 {
  transform: translateY(28px) scale(.92);
}

.nuda-ta2-stack__text {
  flex: 1;
  color: #e6e6e6;
  font-size: .78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nuda-ta2-stack__badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 .35rem;
  border-radius: 99px;
  background: var(--c);
  color: #0a0a0a;
  font-size: .68rem;
  font-weight: 800;
}

@keyframes _nuda-ta2stackin1 {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes _nuda-ta2stackin2 {
  from {
    opacity: 0;
  }
  to {
    opacity: .7;
  }
}

@keyframes _nuda-ta2stackin3 {
  from {
    opacity: 0;
  }
  to {
    opacity: .4;
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-ta2-stack__item {
    animation: none;
    transition: none;
    opacity: 1;
  }
  .nuda-ta2-stack__item--2 {
    opacity: .7;
  }
  .nuda-ta2-stack__item--3 {
    opacity: .4;
  }
}

How to use Stacked Toast Group

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 toasts & alerts components

← Browse all NudaUI components