How to Prompt widgets in Magento 2 platform?

Learn how to prompt the widgets in Magento 2 platform with hassle-free steps in this blog.

The prompt widget source is


It also enlarges the Magento model widgets:

The design pattern for the model pop-up windows in the administration is explained in the Magento admin Pattern Library, Slide-Out Panel, Modal Window, Overlays Topics.

Get A Fully-Optimized E-commerce Shopping Experience For You!!!

Initialize the prompt widgets in Magento 2

The prompt widgets can be initialized with or without binding to a certain component.

Initialization on an element

    title: 'Prompt title',

    actions: {

        confirm: function(){}, //callback on 'Ok' button click

        cancel: function(){}, //callback on 'Cancel' button click

        always: function(){}


Standalone initialization


], function(prompt) { // Variable that represents the `prompt` function


        title: 'Some title',

        content: 'Some content',

        actions: {

            confirm: function(){},

            cancel: function(){},

            always: function(){}





 There are some options in prompt widgets which you can use


  • Widgets call back
  • Object type

Auto open

  • automatically open prompt widgets when the widgets are initialized
  • Boolean type

Clickable overlay

  • Close the prompt widgets when the user clicks on the overlay
  • Boolean type


  • Prompt widgets content
  • String type


  • The title of the prompt widgets
  • String type


These prompt widgets execute the following event:

  • Confirm
  • Cancel
  • Always

These are some prompt widgets in Magento 2. I hope this information helps you to prompt widgets.

Prompt widgets in Magento 2



, ,



Leave a Reply

Your email address will not be published. Required fields are marked *