@personalsoft/alert
v1.0.1
Published
A tiny alert dialog API.
Downloads
2
Readme
Alert Dialog
A tiny vanilla JS alert dialog API.
Installation
Use the bellow command to add notify to your existing project.
npm install @personalsoft/alert-dialog --save
# or
yarn add @personalsoft/alert-dialog
You can also download de source and import files from /dist
directory.
<script src="dist/alert.min.js"></script>
Usage
const options = {
title: 'Alert Title',
text: 'Alert content <strong>strong text</strong>!',
};
alert.show(options);
API
| Option | Type | Default | Description | | ------------------------- | --------------------- | ------------- | ------------------------------------------------- | | title | string or HTMLElemt | '' | Sets a title to the dialog | | text | string or HTMLElement | '' | Main content to the dialog | | showConfirmationButton | boolean | true | Show or hide confirmation button on dialog footer | | confirmationButtonContent | string or HTMLElement | 'Ok' | Sets a content to the button | | confirmationButtonAction | function | alert.close() | Function called on click event | | showCancelButton | boolean | false | Show or hide cancel button on dialog footer | | cancelButtonContent | string or HTMLElement | 'Cancel' | Sets a content to the button | | cancelButtonAction | function | alert.close() | Function called on click event |
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
ISC