Category: How do I do X?
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How do I show a toast in an app

Issue

I am trying to figure out how to show toasts on my Appsmith app. I am not sure whether to use the system toast or an external library. I have tried some external libraries, but they don't seem to work with Appsmith. I am looking for recommendations on which external library to use, if necessary.

Resolution

The recommended way to show toasts in Appsmith is by using the showAlert() call, which is a built-in function that displays a temporary toast-style alert message to the user for 5 seconds. This eliminates the need for an external library.

To use showAlert(), simply call it with a message parameter that contains the text you want to display in the toast notification. For example:

showAlert("Data saved successfully!");

This will display a notification with the message "Data saved successfully!" that will automatically disappear after 5 seconds.

By using the built-in showAlert() function, you don't have to worry about compatibility issues with external libraries, and can easily customize the style and behavior of the toast notifications to fit your app's needs.