Creating a message
In the above example, we’re providing a
body are self-explanatory, these will be placed in the same positions within the message component.
parent is where you supply the parent element. This element will be the container for this message. The message will be appended to its parent once it has been constructed.
You can also supply additional options to a message when you’re creating it. These include:
isDismissable- This is a boolean value and determines if the close button is added to the message.
dismissInterval- This is an integer and specifies the number of milliseconds the message is visible before it is automatically hidden.
destroyOnDismiss- This is a boolean value and determines if the message should be removed from the DOM when it is dismissed via the button or automatically after the
color- This is a string value and determines the color of the message. Any color property from Bulma is supported such as
info. This simply adds a class to the element for example
is-successand so can be used with your own color modifiers.
size- This is a string value and determines the size of the message. Any size property from Bulma is supported such as
small. This simply adds a class to the element for example
is-largeand so can be used with your own size modifiers.
Showing/hiding a message
message object allowing you to call the
hide() messages on it.
data-dismiss-interval this will take an integer of the number of milliseconds to wait before hiding the message.
If you would like to provide the user with the ability to dismiss a message, simply include the delete button!