Notifications
Notifications are a handy JavaScript component for displaying messages to the user
for whatever reason. Notifications are highly customizable from both a CSS and
JavaScript perspective.
Example
To display a notification, call the Notifications module with your options via the
module loader.
Options
Notifications can also be used to confirm a user action via callbacks. Below is an example of a notification with all options. Please see the table for full details details.
Constructor Arguements
| Option key | Value | Behavior |
|---|---|---|
| type | stringprimary|info|success|warning|danger |
Contextualizes styling. |
| msg | string |
Text to be displayed inside the notification. |
| isCallback | boolean |
Does the notification have a callback when it is closed by the user? |
| cancelText | string |
Text to be displayed in cancel button. |
| confirmText | string |
Text to be displayed in confirm button. |
| cancelClass | string |
Classname to be applied to cancel button. |
| confirmClass | string |
Classname to be applied to confirm button. |
| onCancel | function |
JavaScript function to be called when the cancel button is clicked. |
| onCancelArgs | array |
Array of arguments to be passed to the cancel callback. |
| onConfirm | string |
JavaScript function to be called when the confirm button is clicked. |
| onConfirmArgs | array |
Array of arguments to be passed to the confirm callback. |