Alert Component

The toast notification system allows you to display temporary pop-up messages (toasts) with different styles (success, warning, info, error) in your application.

Component Visuals

To unlock early access to the component Get Access

Installation

To install the Quest react-sdk into your project, follow these steps:

  • Open your terminal/command prompt.

  • Navigate to your project's root directory using the cd command if you're not already there.

  • Run the following command to install the quest-sdk package using npm:

This command will download and install the package and its dependencies into your project.

Make sure your project has npm and Node.js installed, and that you have the necessary permissions to install packages in your project directory.

Usage

To display a toast notification, you can use the following methods:

showToast.success({ text, duration })

Displays a success toast message.

  • text (optional): The text message to display in the toast (default: 'This is a success message').

  • duration (optional): The duration (in milliseconds) for which the toast is displayed (default: 2000ms).

Example:

Similarly we have showToast.warn, showToast.error, showToast.info as well

Or you can pass a custom element to showToast example:

Example Usage

Here's an example of how to use the showToast service within your React application:

This documentation provides an overview of the showToast service, installation instructions (not required), usage examples, and customization options. You can adapt it to your specific needs and provide more details if necessary.

Demo

Last updated