rtm

Basic Usage

Learn the basics of triggering toasts.

Ask ChatGPT

The toast function is a versatile tool for showing notifications.

Simple Notifications

The most common way to show a toast is by using one of the shorthand methods:

tsx
1import { toast } from "react-toast-msg";
2
3// Success toast
4toast.success("Action completed!");
5
6// Error toast
7toast.error("Something went wrong.");
8
9// Warning toast
10toast.warning("Check your settings.");
11
12// Default/Info toast
13toast("Here is some information.");

Custom Message

You can pass any string as the first argument to these methods.

tsx
1toast.success("Order #12345 has been shipped!");

Timing

By default, toasts disappear after 3 seconds. You can change the global duration in ToastContainer or set it per-toast (see Advanced Usage).

How is this guide?

Last updated on February 17, 2026