rtm

Toast API

Reference for the toast function and its methods.

Ask ChatGPT

The toast object provides several methods to trigger notifications with different styles.

toast(message, type, duration)

The main function for showing a toast.

ParameterTypeDefaultDescription
messagestring-The message to display.
typeToastType'default'The style of the toast.
durationnumber3000Time in ms before auto-close.

Methods

toast.success(message, duration?)

Shorthand for toast(message, duration).

toast.error(message, duration?)

Shorthand for toast.error(message, duration).

toast.warning(message, duration?)

Shorthand for toast.warning(message, duration).

toast.default(message, duration?)

Shorthand for toast(message, duration).

Example

tsx
1import { toast } from "react-toast-msg";
2
3toast.success("Profile updated", { duration: 2000 });

How is this guide?

Last updated on February 17, 2026