Stacked toast notifications
Toasts stack like a deck, fan out on hover and swipe away. Free.
Toasts stack like a deck, fan out on hover and swipe away. Free.
"use client";
import { Toaster, toast } from "@/components/toast-stack/ToastStack";
export default function Page() {
return (
<>
<Toaster />
<button onClick={() => toast("Saved")}>Save</button>
</>
);
}npx shadcn@latest add https://teodoravadani.github.io/qodesign-free/r/toast-stack.jsonnpx shadcn@latest add https://teodoravadani.github.io/qodesign-free/r/toast-stack.jsonAll comparisons, with prices read on each library's own site.
Yes, as a client component. Keep "use client" at the top of the file that renders it, as in the snippet above. App Router and Pages Router both work.
Yes. It goes from spinner to check when the promise resolves.
The Radix version is. Its docs page says "The toast component has been deprecated. Use the sonner component instead." The Base UI version of shadcn still has a Toast component.
Install Sonner, or Toast Stack if you want the stacked look. Both use toast("Saved") with no hook. For Toast Stack, the shim above keeps old toast({ title, description, variant }) calls working while you change them over.
Yes. MIT licence, no email needed for the registry install.
Yes. The folder has a PROMPT.md. Paste it into Cursor, Lovable, v0 or Claude Code.
"use client";
import type { ReactNode } from "react";
import { toast as stack } from "@/components/toast-stack/ToastStack";
// Keeps the old shadcn call shape, toast({ title, description, variant }), working on Toast Stack.
type OldToast = {
title?: ReactNode;
description?: ReactNode;
variant?: "default" | "destructive";
duration?: number;
// The old ToastAction element becomes a plain object. TypeScript flags each call that still passes JSX.
action?: { label: string; onClick: () => void };
};
function toast({ title = "", description, variant, duration, action }: OldToast) {
const show = variant === "destructive" ? stack.error : stack;
const id = show(title, { description, duration, action });
return { id, dismiss: () => stack.dismiss(id) };
}
function useToast() {
return {
toast,
// No id closes every toast, like the old dismiss().
dismiss: (id?: number) => (id === undefined ? stack.clear() : stack.dismiss(id)),
};
}
export { toast, useToast };