Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

your-toast is a small toast-notification library for React and Next.js. Its documented design keeps the calling API separate from notification state and rendering: an API call enters a toast store, and YourToastProvider subscribes to that store and renders the active stack. You can use short calls such as toast.success("Saved successfully!"), then switch to promise handling, programmatic updates, dismissal, descriptions, durations, or action buttons when an interaction needs more control.

Masaud Ahmod describes the goal as: “Keep the API simple while giving developers enough control when they need it.” The examples and compatibility statements below are attributed to the project article and README; they are documentation claims rather than results from an independent runtime test.

What problem does your-toast solve?

Toast notifications are brief, non-blocking messages that confirm an event without taking the user away from the current screen. Typical messages include “Saved successfully.” after a settings change, “Something went wrong.” after a failed request, “Uploading…” while a file is being sent, and “File deleted — Undo” when an action can be reversed.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Without a shared notification layer, each form, upload control, and data-mutation hook tends to implement its own timeout, loading state, error handling, and close button. The project presents your-toast as a compact way to centralize those behaviors while retaining an imperative API that can be called from event handlers or asynchronous code.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
  • Use it for transient feedback: saves, authentication responses, API requests, uploads, CRUD operations, settings changes, and background work.
  • Use a promise flow for one operation with several states: show loading, then replace it with success or error.
  • Use IDs when a later event must control an earlier toast: update its text, change its type, or dismiss it.

It is not a data-fetching library or a form-state manager. It communicates the state of work that your application already performs.

How the documented architecture works

The article describes a four-part flow:

Toast API → Toast Store → YourToastProvider → UI

1. Toast API

Calls such as toast.success(), toast.error(), or toast.loading() create a notification request. The API is imperative, so a component does not need to hold a separate piece of React state just to display a message.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Toast store

The internal store tracks active toast objects. A toast object contains the information needed to render the notification, such as its variant, message, optional description, duration, and action configuration. Calls that return an identifier let you refer to that object later.

3. YourToastProvider

The provider observes store changes. The author says it subscribes with React’s useSyncExternalStore, which is React’s subscription API for external state. This keeps the store independent from any individual component’s local state while allowing React to update when the active-toast list changes.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

4. Rendered UI

The provider renders the current notifications and manages the visible stack. The README describes automatic stack management, so callers can issue multiple notifications without manually building a list component. The exact visual styling and interaction details remain part of the package implementation rather than the API contract shown in the documentation.

Install and mount the provider

The README documents installation with npm:

npm install your-toast

Mount one provider at the application boundary where notifications should be available. Keep the provider mounted for the lifetime of the application; mounting it repeatedly inside individual pages can create multiple notification surfaces and make dismissal behavior harder to reason about.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

React with Vite

For a React/Vite application, the documented pattern imports both the provider and the toast API from the package, then renders the provider once near the root.

import { YourToastProvider, toast } from "your-toast";
import { createRoot } from "react-dom/client";
import App from "./App";

createRoot(document.getElementById("root")).render(
  <YourToastProvider>
    <App />
  </YourToastProvider>
);

After that boundary exists, any descendant can call the API from an event handler:

function SaveButton() {
  function handleSave() {
    // Perform your save operation here.
    toast.success("Saved successfully!");
  }

  return <button onClick={handleSave}>Save</button>;
}

The provider is the rendering boundary; the component that calls toast does not need to import or render a toast list.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Next.js App Router

The README uses a separate provider entry for the App Router:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { YourToastProvider } from "your-toast/provider";

Place that provider in the root layout around the application content:

import { YourToastProvider } from "your-toast/provider";

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        <YourToastProvider>{children}</YourToastProvider>
      </body>
    </html>
  );
}

The project documentation says the root layout can remain a Server Component. Trigger the toast from a Client Component instead:

"use client";

import { toast } from "your-toast";

export function SaveButton() {
  return (
    <button onClick={() => toast.success("Saved successfully!")}>
      Save
    </button>
  );
}

This split is the important App Router boundary: the provider has a dedicated package entry, while browser-side interaction and the imperative toast call live in a component marked "use client". A Server Component should not attempt to call the client-side toast API during server rendering.

API at a glance

Call Purpose Typical message or result
toast(message) Default notification General status information
toast.success(message) Positive confirmation "Saved successfully!"
toast.error(message) Failure notification "Something went wrong."
toast.warning(message) Caution or recoverable issue Warn before continuing
toast.info(message) Neutral information Explain a background change
toast.loading(message) Work in progress "Uploading…"
toast.promise(promise, messages) Loading, success, and error states for one asynchronous operation Messages can depend on the resolved value or error
toast.update(id, options) Change an existing notification Replace loading with success
toast.dismiss(id) Close one notification Use the identifier returned by the creation call
toast.dismiss() Close all active notifications Clear the current stack

The documentation also lists optional descriptions, durations, and action-button settings. An action can expose an “Undo” control for reversible operations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Handle asynchronous work with toast.promise

toast.promise() represents the three user-visible phases of one operation without requiring separate manual calls. Pass the promise (or promise-producing operation) and messages for loading, success, and error:

const upload = uploadFile(file);

toast.promise(upload, {
  loading: "Uploading…",
  success: "Upload complete!",
  error: "Upload failed."
});

The documented API allows success and error messages to depend on the result. That is useful when a response contains a server-generated name or when an exception includes a safe, user-facing explanation:

toast.promise(saveSettings(), {
  loading: "Saving settings…",
  success: (result) => `Saved ${result.changed} settings.`,
  error: (error) => error.message || "Could not save settings."
});

Use a promise toast when the loading and terminal states belong to the same operation. If an operation can continue indefinitely, prefer a loading toast that you explicitly update or dismiss so the user is not left with an inaccurate status.

Update or dismiss a toast yourself

When you need a separate callback or event source, create a toast, retain its returned ID, and update it later:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const id = toast.loading("Uploading…");

uploadFile(file)
  .then(() => {
    toast.update(id, {
      type: "success",
      message: "Upload complete!"
    });
  })
  .catch(() => {
    toast.update(id, {
      type: "error",
      message: "Upload failed."
    });
  });

The README documents toast.dismiss(id) for one notification and toast.dismiss() for every active notification. A targeted dismissal is appropriate when a component unmounts or an operation is cancelled; the no-argument form is better reserved for an intentional global reset.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Descriptions, durations, and actions

Short messages are often enough, but the documented options let you add context:

toast.error("Could not delete the file", {
  description: "Check your connection and try again.",
  duration: 8000
});

Duration controls how long a non-loading toast remains visible. Loading notifications are documented as remaining visible until they are updated or dismissed, which prevents an in-progress message from disappearing before the operation finishes.

An action button is useful when the next step is immediate and reversible:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
toast("File deleted", {
  action: {
    label: "Undo",
    onClick: () => restoreFile(fileId)
  }
});

Keep the action’s callback safe to repeat or guard it against duplicate clicks. The toast communicates the opportunity; your application still owns the undo transaction and its error handling.

Choosing the right notification pattern

Situation Recommended pattern Reason
Immediate confirmation after a synchronous UI change toast.success() One short-lived terminal message is sufficient.
Request with loading, success, and failure states toast.promise() Keeps all phases tied to one asynchronous operation.
Long-running upload or background task toast.loading() plus toast.update() You control the message until completion or cancellation.
Destructive action that can be reversed Toast with an action button The user gets an immediate undo affordance.
Cancellation or page-level reset toast.dismiss(id) or toast.dismiss() Removes stale notifications deliberately.

What the project claims about support

The README claims TypeScript support, compatibility with React 18 and React 19, friendliness with Next.js App Router and Vite, and both ESM and CommonJS builds. These are project documentation claims; no independent compatibility matrix, version-by-version test, or current registry verification was established here.

The available material also does not establish a current package version, download count, release cadence, or maintenance status. Check the package and repository at the time you adopt it, especially if your application depends on a specific React or Next.js release.

Planned ideas versus shipped behavior

The article and README mention several roadmap ideas: improved animation, a theme system, mobile refinements, progress indicators, swipe-to-dismiss, custom icons, and custom React content. They are plans, not features you should assume are available in the documented API. Build against the calls and options currently described, and treat any roadmap item as subject to change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting the setup

No toast appears in a React/Vite app

  • Confirm that YourToastProvider wraps the component that calls toast.
  • Mount one provider at the application root rather than inside a conditional page branch.
  • Check that the call runs in an event handler or other browser-side code after the app is mounted.

Next.js reports a client/server boundary problem

  • Import the provider from your-toast/provider as documented for the App Router.
  • Leave the root layout as a Server Component if desired, but put the toast call in a component beginning with "use client".
  • Do not invoke the imperative API during server rendering.

A loading message never goes away

  • Ensure the promise settles, or call toast.update(id, ...) when your callback receives the result.
  • On cancellation, call toast.dismiss(id) for the loading toast.
  • Keep the identifier returned by the creation call; without it you cannot target that specific notification.

Too many notifications accumulate

  • Use one toast for one operation instead of firing a new toast from every polling tick or render.
  • Prefer toast.promise() for a single request with multiple states.
  • Use targeted dismissal when a component or task is no longer active.

When would you use your-toast?

Use it when your React or Next.js application needs a shared, lightweight feedback channel and you want calls that remain simple for routine events. The provider/store separation is especially useful when many unrelated components need to raise notifications, while promise handling and update/dismiss controls cover asynchronous and reversible interactions. If you need a highly customized design system, advanced animation, or guarantees about a particular unreleased feature, verify the package’s current implementation before committing to it.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.