--- title: Notification layout: documentation doc-tab: elements doc-subtab: notification breadcrumb: - home - documentation - elements - elements-notification meta: colors: true sizes: false variables: true --- {% capture notification %}
Lorem ipsum dolor sit amet, consectetur adipiscing elit lorem ipsum dolor. Pellentesque risus mi, tempus quis placerat ut, porta nec nulla. Vestibulum rhoncus ac ex sit amet fringilla. Nullam gravida purus diam, et dictum felis venenatis efficitur. Sit amet, consectetur adipiscing elit
{% endcapture %} {% capture notification_colors %} {% for color in site.data.colors.justColors %}
Primar lorem ipsum dolor sit amet, consectetur adipiscing elit lorem ipsum dolor. Pellentesque risus mi, tempus quis placerat ut, porta nec nulla. Vestibulum rhoncus ac ex sit amet fringilla. Nullam gravida purus diam, et dictum felis venenatis efficitur. Sit amet, consectetur adipiscing elit
{% endfor %} {% endcapture %} {% capture notification_js_html %}
Lorem ipsum
{% endcapture %} {% capture notification_js_code %} document.addEventListener('DOMContentLoaded', () => { (document.querySelectorAll('.notification .delete') || []).forEach(($delete) => { $notification = $delete.parentNode; $delete.addEventListener('click', () => { $notification.parentNode.removeChild($notification); }); }); }); {% endcapture %}

The notification is a simple colored block meant to draw the attention to the user about something. As such, it can be used as a pinned notification in the corner of the viewport. That's why it supports the use of the delete element.

{% include elements/snippet.html content=notification %} {% include elements/anchor.html name="Colors" %}

The notification element is available in all the different colors defined by the $colors Sass map.

{% include elements/snippet.html content=notification_colors %}

Javascript delete notification

The Bulma package does not come with any JavaScript. Here is however an implementation example, which sets click handler for delete elements of all notifications on the page, in Vanilla Javascript.

{% highlight html %}{{ notification_js_html }}{% endhighlight %} {% highlight javascript %}{{ notification_js_code }}{% endhighlight %}
{% include elements/variables.html type='element' %}