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

Overview

The JavaScript Modal Dialog is a useful user interface (UI) control for informing users about critical information, errors, warnings, and questions, as well as confirming decisions and collecting input from users. The control has a rich set of built-in features such as action buttons, positioning, animations, dragging, resizing, templating, and more with mobile dialog support. The dialog contains modal dialogs and non-modal dialogs (modeless) based on interactions.


The JavaScript Dialog control comes with two different types of dialogs, modal and non-modal (modeless):

  • Modal dialogs force users to interact with them before continuing. They are used to show important interaction information and non-continuous process information (for example, a sign-up or login form).
  • Non-modal dialogs allow users to interact outside the dialog box even if it is in an active state, which is suitable for frequent and nonblocking dialogs (for example, find-and-replace dialogs).

Dialog UI elements

The JavaScript Dialog control provides headers (titles), body (content), and an action area/footer for better customization.


Action buttons

The JavaScript Dialog control provides built-in support to perform actions through buttons, which define necessary callback functions to handle user input.


Positioning

Users can position a dialog wherever they want in a page. It is easy to configure this through built-in positions or any custom axis value (for example: top left, bottom right, top right, bottom left, 100 75).


Draggable

A modal dialog can be moved anywhere in a page by dragging its header, which is performed by using the Draggable library.


Templates

In Dialog the template support is provided to the header, content and footer sections. So any text or HTML content can be appending in these sections.

Template in JavaScript Dialog


Localization in JavaScript Modal Dialog

Localization

Localization library allows to localize the default text content of Dialog. In Dialog, the close button’s tooltip text alone will be localize based on culture.


Appearance

The following content provides the exact CSS structure that can be used to modify the control’s appearance based on the user preference.

Appearance in JavaScript Modal Dialog


Overlays

Modal dialogs create overlays on open modal windows that provide options for a user to control the closing behavior of a dialog while interacting with it.

HTML5 JavaScript Dialog with overlay


Additional dialogs

Users can launch multiple dialogs simultaneously or one above the other based on their z-index (z-depth) to make additional dialogs (nested modal dialogs).


Animation

A variety of smooth, built-in animations are available to configure for the opening and closing of modal dialogs. They perform based on CSS3 animation from the Animation library.


Resizable

The modal dialog can resize from any of the edges or borders of the dialog within the target container by using its handle (grip) or hovering over it.


Close options

A modal dialog can be closed by clicking on a close icon, with an overlay click, or by pressing the ESC key. Users can also restrict the closing behavior of a dialog based on its callback function parameters.


Remote content via AJAX

Users can directly load content from a remote source (like an external webpage) into a dialog using the AJAX library.


Alert and confirmation dialogs

Create JavaScript alerts and confirmation dialogs using built-in functions.


Right-to-left (RTL)

The JavaScript Dialog control supports right-to-left (RTL) rendering. Users can change the text direction and layout of the Dialog control from to RTL. This improves the user experience and accessibility for those who use RTL languages.


JavaScript Modal Dialog covers web accessibility

Accessibility

  • Fully supports WAI-ARIA accessibility, which helps dialogs be accessed by on-screen readers and assistive devices.

  • Follows WAI-ARIA Best Practices for implementing keyboard interaction.

  • Follows the WCAG 2.0 standard in the design of UI element visuals–such as foreground color, background color, line spacing, text, and images.

JavaScript Dialog works well in touch devices

Responsiveness

The JavaScript Dialog control is highly configurable to give mobile dialogs better user experiences across phone, tablet, and desktop form factors.


Themes

The JavaScript Dialog control has several built-in themes such as 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.

Developer-friendly APIs

Developers can control the appearance and behaviors of a dialog, including its positioning, content, and animation, using a rich set of APIs.


Other supported frameworks

The Modal Dialog component is also available in Blazor, React, Angular, and Vue frameworks. Check out the Modal Dialog in different platforms from the following links:


JavaScript Dialog Code Example

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

<div>
    <!--element which is going to render the Dialog -->
    <button class="e-control e-btn" id="targetButton" role="button" e-ripple="true">Open Dialog</button>
    <div id="dialog"></div>
</div>
import { Dialog } from '@syncfusion/ej2-popups';

// Initialization of Dialog component
let dialog: Dialog = new Dialog({
    // Dialog content
    content: 'This is a Dialog with content',
    // The Dialog shows within the target element
    target: document.getElementById("container"),
    // Dialog width
    width: '250px'
});

// Render initialized Dialog
dialog.appendTo('#dialog');



80+ JAVASCRIPT UI CONTROLS

Frequently Asked Questions

Syncfusion JavaScript Dialog provides the following features:

  • Highly customizable and configurable user interface (UI) dialog box.
  • Simple way to diaplay critical information, errors, warnings, confirmations, alerts, questions, and message boxes.
  • Built-in features such as action buttons, drag-and-drop, positioning, animations, and themes.
  • Simple configuration and API.
  • Support for all modern browsers.
  • Expansive learning resources such as demos and documentation to get you started quickly with JavaScript Dialog component.

You can find our JavaScript Dialog demo here.

No, this is a commercial product and requires a paid license. However, a free community license is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue, 5 or fewer developers, and 10 or fewer total employees.

A good place to start would be our comprehensive getting started documentation.

Our Customers Love Us

Having an excellent set of tools and a great support team, Syncfusion reduces customers’ development time.
Here are some of their experiences.

Rated by users across the globe

Transform your applications today by downloading our free evaluation version Download Free Trial

Awards

Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.

Up arrow icon
Live Chat Icon For mobile