Trusted by the world’s leading companies

Syncfusion Trusted Companies

Overview

The React Toast is a small, nonblocking notification pop-up. It is a readable message displayed at the bottom of the screen or at a specific target and disappears automatically after a few seconds (time out) with different animation effects. The control has various built-in options for customizing visual elements, animations, durations, and dismissing toasts.


React Toast Code Example

Easily get started with the React Toast using a few simple lines of TSX code example as demonstrated below. Also explore our React Toast Example that shows you how to render and configure a Toast in React.

import { ToastComponent } from '@syncfusion/ej2-react-notifications';
import * as React from "react";

class App extends React.Component<{}, {}> {
public toastInstance:ToastComponent;

public toastCreated(): void {
this.toastInstance.show();
}

public render() {
return (
  <ToastComponent title="Sample Toast Title" content="Sample Toast Content" created={this.toastCreated = this.toastCreated.bind(this)} />
);
}
};
ReactDOM.render(<App />, document.getElementById('element'));


Interactive toasts

Users can create a more interactive toast message by configuring inputs and buttons on the notification pop-up that help them react quickly (for example, reply to a chat message directly from the toast pop-up).


Visual elements

A normal toast notification can be designed with a plain text, and optional images, icons, inputs, and buttons. Users can load HTML content and change the content dynamically inside the toaster with templates.


Positioning notifications

The React toast notifications component is easily positioned wherever you want using built-in positions or custom axis values (X, Y).


Animation

Users can configure different animations to show or hide the toast and the animation duration based on the content length of the notification message and reading time.


Dismiss toasts

Users can dismiss all Angular Toast notifications using user input or timeouts. Notifications can also be dismissed by swiping or tapping them.


Multiple notifications

Users can display multiple toast notifications in a sequence (queue up) within a set duration. Also, users can change the order of a toast notification sequence to the newest on top.


Toast message types

Users can easily design common Angular toast notifications using built-in classes such as alert, success, warning, information, and error.


Timing (duration)

The React toast notification component can be configured with a duration time for a complete message to be read before it is hidden. You can extend the timeout dynamically after focusing on it.


Progress bar

Users can enable a progress bar inside the toast to track the progress of an operation and the expiration of a toast message.


Toast message verification

Users can verify duplicate toast notifications and allow only distinct messages on the screen. They can restrict the maximum number of toasts to be displayed. Also, users can prevent toast messages from hiding and make them stick with the screen.


Appearance in React Toast

Appearance

Customize the look and feel of the Toast by changing its fill color, background, border, and item opacity.


Accessibility

  • Fully supports WAI-ARIA accessibility that makes toast accessible to on-screen readers and assistive devices.
  • Follows the WCG 2.0 standard in the design of the UI element visual such as foreground color, background color, line spacing, text, and images.

Developer-friendly API

Developers can control the appearance and behaviors of the toast notification component, including its positioning, using a rich set of APIs.




Other Supported Frameworks

In addition to React, built-in integration is available for these major frameworks.

Explore all Syncfusion React components

Explore over 140+ React UI components featuring established, and production-ready controls built for modern web app development.