Magento – Magent2 Modal Widget – change width and height

magento2modal-popupwidget

I am interesting in all the options that are available for the Magento Ui modal popup widget. Like:

var options = {
 type: 'popup',
 responsive: false,
 innerScroll: false,
 ......
}

Mainly for the size of the popup itself. I tried a couple of options like

size: 'sm'

as well as

width: 400,
height: 400

but nothing works. Is there documentation for the possible options you can pass to the modal widget?

Best Answer

<a href="javascript:;"  class="bt-action" data="More Info"  >More Info</a><div class="bt-action-file" style="display: none;">Content here</div> 
require(
        [
            'jquery',
            'Magento_Ui/js/modal/modal'
        ],
        function(
            $,
            modal
        ) {

            var options = {
                type: 'popup',
                responsive: true,
                innerScroll: false,
                title: 'My Title',
                buttons: []
            };

            $(".bt-action").click(function() {

                $(".bt-action-file").modal(options).modal('openModal');

            });

        }
    );
<style type="text/css">
    .modal-popup .modal-inner-wrap{ width: 50%; }
</style>
Related Topic