py_ets

Toast Notification

Component

About

An accessible, auto-dismissing toast notification system with a title, optional description, and close button, queued globally and shown in the corner of the screen.

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

Code

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

Usage.tsx

"use client";
import ToastRegion, { queue } from "@/components/ui/tailwind-toast";

export default function ToastDemo() {
  return (
    <div className="flex w-full h-screen items-center justify-center bg-background">
      <ToastRegion />
      <button
        onClick={() =>
          queue.add({
            title: "Files uploaded",
            description: "3 files uploaded successfully.",
          })
        }
        className="inline-flex items-center justify-center rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 focus-visible:outline-2 focus-visible:outline-blue-600 focus-visible:outline-offset-2"
      >
        Show Toast
      </button>
    </div>
  );
}

Dependencies

More by py_ets

View all
  • Alert Dialog

    Alert Dialog

    13
  • React Aria CheckboxGroup

    React Aria CheckboxGroup

    9
  • Command Palette

    Command Palette

    7
  • Progress Bar

    Progress Bar

    7
  • React Aria DatePicker

    React Aria DatePicker

    6
  • Segmented Control

    Segmented Control

    4
  • React Aria Tree

    React Aria Tree

    4
  • React Aria Switch

    React Aria Switch

    4