Flash messages, or alerts, inform users of successful or pending actions.
Alerts come in different flavours: warn
, error
, success
and a default if none is specified.
{{ partial "component/alert.html" "Some alert message" }}
{{ partial "component/alert.html" (dict
"Content" "Some alert message"
"Params" (slice "warn")
) }}
{{ partial "component/alert.html" (dict
"Content" "Some alert message"
"Params" (slice "error")
) }}
{{ partial "component/alert.html" (dict
"Content" "Some alert message"
"Params" (slice "success")
) }}
<div class="flash">
Some alert message
</div>
<div class="flash flash-warn">
Some alert message
</div>
<div class="flash flash-error">
Some alert message
</div>
<div class="flash flash-success">
Some alert message
</div>
{{<alert>}}Some alert message.{{</alert>}}
{{<alert warn>}}Some alert message (warn).{{</alert>}}
{{<alert error>}}Some alert message (error).{{</alert>}}
{{<alert success>}}Some alert message (success).{{</alert>}}
<div class="flash">
Some alert message.
</div>
<div class="flash flash-warn">
Some alert message (warn).
</div>
<div class="flash flash-error">
Some alert message (error).
</div>
<div class="flash flash-success">
Some alert message (success).
</div>
Add full
to make the message full width and remove border and border radius.
{{<alert full>}}Some alert message (full).{{</alert>}}
<div class="flash flash-full">
Some alert message (full).
</div>
Add banner
to make the message fixed positioned at the top of the page.
<div style="min-height: 64px;">
{{<alert banner>}}Some alert message (banner).{{</alert>}}
</div>
<div style="min-height: 64px;">
<div class="flash flash-banner">
Some alert message (banner).
</div>
</div>
{{ partial "component/alert.html" (dict
"Content" "Some alert message (warn full banner)"
"Params" (slice "warn" "full" "banner")
) }}
<div style="min-height: 64px;">
<div class="flash flash-warn flash-full flash-banner">
Some alert message (warn full banner)
</div>
</div>
<div style="min-height: 64px;">
{{<alert warn full banner>}}Some alert message (warn, full, banner).{{</alert>}}
</div>
<div style="min-height: 64px;">
<div class="flash flash-warn flash-full flash-banner">
Some alert message (warn, full, banner).
</div>
</div>