const alert = new SmartAlert('Title',
'This is the message to be displayed in the alert.\nDo you see it?\nWell, get started and you too can use this great module!',
'primary',
);
There are four arguments that can be used when instantiating.
The first argument is a string to be displayed in the title field of the alert.
The second argument is a string that specifies the main message to be displayed in the alert.
The third argument is a string type specifying the type of alert.
Smart Alert has the following four types by default.
If this argument is not specified, info is used.
- info
- primary
- warning
- danger
The fourth argument is a string that specifies where to display the alert.
Specify from among the following four strings.
If this argument is not specified, set top-right by default.
- top-left
- top-right
- btm-left
- btm-right
alert.push();
The setColor method can be used to set the background and text colors of the alert.
Specify the background color as the first argument of the setColor method and the text color as the second argument.
const alertRed = new new SmartAlert('Title', 'message');
// set alert color
alertRed.setColor('red', 'white');
// Note that rgba can be specified as the argument of the setColor method, as shown below.
// alertRed.setColor('rgba(255, 255, 255, 0.5)', 'green');
alert.push();
Contributions are welcome! Feel free to make an issue or send us a pull request.
This project is licensed under the MIT License - see the LICENSE file for details