Skip to content

Top Toast Banner

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

Mobile PatternsHTMLCSSany framework
SavedAdded to your reading list

Copy into your project

HTML
<div class="nuda-toptoast" role="status" aria-live="polite">
  <div class="nuda-toptoast__icon" aria-hidden="true">
    <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M5 12l4 4 10-10"/></svg>
  </div>
  <div class="nuda-toptoast__text">
    <strong>Saved</strong>
    <span>Added to your reading list</span>
  </div>
</div>
CSS
/* Top Toast Banner
   Glass banner that slides down from the top and dismisses.
   Customize: --toast-bg, --toast-success */

.nuda-toptoast {
  --toast-bg: rgba(20, 20, 25, 0.85);
  --toast-success: #10b981;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 280px;
  padding: 10px 14px;
  background: var(--toast-bg);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.55);
  font-family: system-ui;
  animation: nuda-toptoast 3.5s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.nuda-toptoast__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--toast-success);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nuda-toptoast__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font: 500 11px/1.3 system-ui;
  min-width: 0;
}

.nuda-toptoast__text strong { color: #fafafa; font-weight: 600; font-size: 12px; }
.nuda-toptoast__text span { color: #a0a0a8; }

@keyframes nuda-toptoast {
  0% { opacity: 0; transform: translateY(-30px); }
  10%, 80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-30px); }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-toptoast { animation: none; opacity: 1; transform: none; }
}

How to use Top Toast Banner

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 mobile patterns components

← Browse all NudaUI components