Alert

Summary

Alerts should be used to provide feedback to the user. They are intended to serve informational message, errors and warnings.

It is possible to set a title for an alert. Simply add an element that has the class zui-alert-title on it and it will act as the title.

In order to make alerts closable, simply add the close icon. JavaScript will automatically recognize it and close the alert when you click on it.

Name Description Default Value
data-zui-alert-timeout

When this attribute is set, it will close the alert after the given timeout. The value is in milliseconds.

No values have been documented for this attribute.

data-zui-alert-fade-speed

When the data-zui-alert-fade-speed attribute is set, it will be used as the fadeout speed. The value is in milliseconds.

No values have been documented for this attribute.

role

Depending on the type of alert the role attribute must be set. If the alert is an information message, the role attribute must be set to status. If the alert is a dangerous message or a warning message, the role attribute must be set to alert.

No values have been documented for this attribute.

Example

Information message

This is a message.

Very nice eh?!

Markup

<div class="zui-alert">
    <p class="zui-alert-title">
        <strong>Information message</strong>
    </p>

    <p>
        This is a message.
    </p>

    <span class="zui-icon zui-icon-x" role="button" tabindex="0"></span>
</div>
Fork me on GitHub