NexusUI

Toast Stack

Component

About

A stack of toast notifications that fans out into a list on hover or focus, can be swiped away, and auto-dismisses on a per-toast countdown.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Toast Stack to your project and fits it to your theme.

Code

How Toast Stack is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import ToastStack, { useToastStack } from "@/components/ui/toast-stack";

export default function ToastStackDemo() {
  const { toasts, push, dismiss } = useToastStack();

  return (
    <div className="flex min-h-[420px] w-full flex-col items-center justify-center gap-6 bg-[#f5f5f7] p-8 dark:bg-black">
      <button
        type="button"
        onClick={() =>
          push(
            {
              title: "Changes saved",
              description: "Your profile was updated.",
              type: "success",
              action: { label: "Undo" },
            },
            { sound: true },
          )
        }
        className="rounded-full bg-[#1d1d1f] px-5 py-2.5 text-[13px] font-medium text-white transition-colors hover:bg-[#1d1d1f]/90 dark:bg-white dark:text-[#1d1d1f] dark:hover:bg-white/90"
      >
        Add toast
      </button>
      <ToastStack toasts={toasts} onDismiss={dismiss} position="bottom" />
    </div>
  );
}

Dependencies

More by NexusUI

View all
  • Circular Carousel

    Circular Carousel

    1.4K
  • Images Badge

    Images Badge

    1K
  • Chat Messages

    Chat Messages

    380
  • Aquarium Prompt

    Aquarium Prompt

    223
  • Infinite Moving Cards

    Infinite Moving Cards

    201
  • Cinematic Logo Cloud

    Cinematic Logo Cloud

    187
  • Shooting Stars Grid

    Shooting Stars Grid

    163
  • Pixel Atlas

    Pixel Atlas

    133