Basic Usage
Learn the basics of triggering toasts.
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:
tsx1import { toast } from "react-toast-msg";23// Success toast4toast.success("Action completed!");56// Error toast7toast.error("Something went wrong.");89// Warning toast10toast.warning("Check your settings.");1112// Default/Info toast13toast("Here is some information.");
Custom Message
You can pass any string as the first argument to these methods.
tsx1toast.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