We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Trusted by the world’s leading companies

Syncfusion Trusted Companies


The JavaScript Message is a graphical user interface control that displays messages with visual severity levels. It differentiates messages with icons and colors to denote the importance and context of the message. It has several built-in features, such as severities, variants, icons, and a template.


Display messages with predefined severity types that have distinctive icons and colors to convey their importance to the user. The available severity types are normal, success, info, warning, and error.

JavaScript Message severity.


Message has predefined appearance variants for different visual representations of messages: text, outlined, and filled.

JavaScript Message variants.


Users tend to understand visual information better than text. Include severity icons to the left of the message content to provide a visual representation of the message urgency. Users may want to hide some messages once they’ve read them. Include a close icon to the right of the message content to hide it through user input.

JavaScript Message icons.

JavaScript Message content alignment.

Content alignment

Normally, message content is aligned to the left. Users can easily align it to the center or right using the built-in classes e-content-center and e-content-right.

UI customization with a template

A template is used to create custom user experiences. The Message component lets you customize the content with a custom structure. The content can be a string, paragraph, or any other HTML element.

Javascript Message template.

JavaScript Message rounded square

Rounded and Square

The corners of the message box can be rounded or squared, by adding a custom class at the application level. Based on this custom class, users can override the message styles to make it round or square. The Message control with rounded corners will have a softer, smoother appearance, while the square corners will have a more JavaScript, defined look.


  • Fully supports WAI-ARIA accessibility practices to work with screen readers and assistive devices.
  • Follows WAI-ARIA best practices for implementing keyboard interaction.
  • Follows WCAG 2.0 standards, in design of the UI visual elements such as foreground color, background color, line spacing, text, and images.
  • Supports right-to-left (RTL) text direction for users working with RTL languages like Hebrew, Arabic, or Persian.

Developer-friendly APIs

Developers can control the appearance and behaviors of the Message component using a rich set of APIs.

Built-in themes

The HTML5/JavaScript Message supports several built-in themes: Material, Bootstrap, Fabric (Office 365), Tailwind CSS, and high contrast. Users can customize any one of these built-in themes or create new themes to achieve their own desired look and feel either by simply overriding SASS variables or using our Theme Studio application.

Other supported frameworks

The Message component is also available for our Blazor, React, Angular, and Vue frameworks. Check it out on the other platforms at these links:

JavaScript Message Code Example

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

<div class="col-lg-12 control-section msg-default-section">
    <div class="content-section">
        <div id="msg_default"></div>
        <div id="msg_info"></div>
        <div id="msg_success"></div>
        <div id="msg_warning"></div>
        <div id="msg_error"></div>

    .msg-default-section .content-section {
        margin: 0 auto;
        max-width: 520px;
        padding-top: 10px;

    .msg-default-section .e-message {
        margin: 10px 0;
import { loadCultureFiles } from '../common/culture-loader';
 *  Message default sample
import { Message } from '@syncfusion/ej2-notifications';

    let msgDefault: Message = new Message({
        content: "Editing is restricted"

    let msgInfo: Message = new Message({
        content: "Please read the comments carefully",
        severity: "Info"

    let msgSuccess: Message = new Message({
        content: "Your message has been sent successfully",
        severity: "Success"

    let msgWarning: Message = new Message({
        content: "There was a problem with your network connection",
        severity: "Warning"

    let msgError: Message = new Message({
        content: "A problem has been occurred while submitting your data",
        severity: "Error"