Free Component

Interactive Notification Toast Stack

A stack of floating toast alert notifications with status icons, timed progress bar, and slide-out dismissal.

  • dark
  • toast
  • notification
  • alerts
  • stack
  • component

Colours in this gradient

  • #0f172a
  • #10b981
  • #3b82f6
  • #ffffff
background: ;

The code

Plain HTML and CSS with no dependencies. Copy a single file, or choose "Full file" for a complete page you can save as index.html and open in a browser.

<div class="toast-stage">
  <div class="toast-stack" id="toastStack">
    <div class="toast-item toast-success" id="toast1">
      <div class="t-icon">โœ“</div>
      <div class="t-body">
        <div class="t-title">Deployment Succeeded</div>
        <div class="t-desc">Edge cluster live in 35 regions (commit #94a1d)</div>
      </div>
      <button class="t-close" onclick="document.getElementById('toast1').remove()">ร—</button>
      <div class="t-progress"></div>
    </div>

    <div class="toast-item toast-info" id="toast2">
      <div class="t-icon">โ„น</div>
      <div class="t-body">
        <div class="t-title">New Webhook Received</div>
        <div class="t-desc">Payload delivered from Stripe API (200 OK)</div>
      </div>
      <button class="t-close" onclick="document.getElementById('toast2').remove()">ร—</button>
      <div class="t-progress" style="animation-duration: 6s;"></div>
    </div>
  </div>
</div>

The AI prompt

Paste this into an AI coding tool to generate the same component, then ask it to adapt the colours, text or framework to your project.

Works with Claude ยท ChatGPT ยท Cursor ยท v0 ยท Bolt ยท Gemini
Create a dark notification toast stack component with auto-dismiss progress lines in HTML and CSS.

Requirements:
- Floating stacked notifications with success and info variants.
- Rounded avatar status icons and custom dismiss cross button.
- Bottom progress bar animating width from 100% to 0%.
- Slide-in entry transition.

Return one HTML file with a <style> block.

How to build it, step by step

  1. 1

    Use display: flex inside toast items with status icon, text, and close trigger.

  2. 2

    Animate entry with translateY and scale.

  3. 3

    Position absolute 3px progress bar at the bottom with linear width keyframe.

Customisation tips

  • Add role='alert' and aria-live='polite' for screen reader accessibility.

More components