modal-bajs
v2.0.0
Published
Show modal dialog so easy
Downloads
12
Maintainers
Readme
📦 Modal BaJS
Installation
npm install notify-bajs
Usage
import ModalBaJS from "modal-bajs";
const modal = ModalBaJS({
content: "<h1>Hello world</h1>"
});
Methods
show()
Manually opens a modal
modal.show();
hide()
Manually hides a modal
modal.hide();
setContent()
modal.setContent("<b>New content here</b>");
update()
Manually update options a modal
modal.update({
animation: "slideup",
maxWidth: 300,
closable: false
});
Optional parameters
animation
: (string) -popup
sideup
(default:popup
)classContainer
: (string) - Customized CSS classcontent
: (string) - Content of the modalmask
: (boolean) - Whether show mask or not (default:true
)closable
: (boolean) - Whether a close (x) button is visible on top right of the modal dialog or not (default:true
)maskClosable
: (boolean) - Whether to close the modal dialog when the mask (area outside the modal) is clicked (default:true
)escClosable
: (boolean) - Whether support pressesc
to close (default:true
)maxWidth
: (number) - Width of the modal dialog