Skip to content

Action Toast

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

Toasts & AlertsHTMLCSSany framework

Comment added

Your review comment was posted to the pull request.

Copy into your project

HTML
<div class="nuda-ta2-action-toast" role="status" aria-live="polite">
  <div class="nuda-ta2-action-toast__icon" aria-hidden="true">&#128172;</div>
  <div class="nuda-ta2-action-toast__body">
    <p class="nuda-ta2-action-toast__title">Comment added</p>
    <p class="nuda-ta2-action-toast__desc">Your review comment was posted to the pull request.</p>
    <div class="nuda-ta2-action-toast__actions">
      <button class="nuda-ta2-action-toast__btn nuda-ta2-action-toast__btn--primary">View</button>
      <button class="nuda-ta2-action-toast__btn">Dismiss</button>
    </div>
  </div>
</div>
CSS
.nuda-ta2-action-toast {
  --c: #e4ff54;
  display: flex;
  gap: .7rem;
  background: #161616;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: .85rem;
  min-width: 270px;
  max-width: 320px;
  animation: _nuda-ta2actiontoastin .4s cubic-bezier(.34,1.56,.64,1) both;
}

.nuda-ta2-action-toast__icon {
  flex-shrink: 0;
  font-size: 1.1rem;
}

.nuda-ta2-action-toast__body {
  flex: 1;
  min-width: 0;
}

.nuda-ta2-action-toast__title {
  color: #fafafa;
  font-size: .85rem;
  font-weight: 600;
  margin: 0;
}

.nuda-ta2-action-toast__desc {
  color: #9a9a9a;
  font-size: .75rem;
  line-height: 1.4;
  margin: .25rem 0 0;
}

.nuda-ta2-action-toast__actions {
  display: flex;
  gap: .5rem;
  margin-top: .6rem;
}

.nuda-ta2-action-toast__btn {
  min-height: 32px;
  padding: 0 .7rem;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.14);
  background: transparent;
  color: #cfcfcf;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s,background .15s;
}

.nuda-ta2-action-toast__btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
}

.nuda-ta2-action-toast__btn:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 2px;
}

.nuda-ta2-action-toast__btn--primary {
  background: var(--c);
  border-color: var(--c);
  color: #0a0a0a;
}

.nuda-ta2-action-toast__btn--primary:hover {
  background: #eeff85;
}

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

@media (prefers-reduced-motion:reduce) {
  .nuda-ta2-action-toast {
    animation: none;
  }
}

How to use Action Toast

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