Alert
An alert highlights what the reader must not miss in the text: a tip, a result, a warning or an error.
Example
Carry on as usual.
Markup
:::alert {type=warning}
#### A short heading for the situation
What happened and what to do next.
:::
- The first line is a
##–#####heading: it names the situation briefly. - After it comes an explanation or the next action. An alert without an explanation stops the build.
- The heading may be left out: the alert is then a short message of one or two lines. This is how you write an announcement for the whole page.
The alert is built on the SIMAI Framework alert (sf-alert).
Variants
Type
type carries the meaning of the message: the colour and the icon depend on
it.
This message needs no action.
Carry on as usual.
The build passed the checks.
Check the parameters before publishing.
The configuration failed the checks.
Without a heading
A short announcement for the whole page — about the docs version, a deadline or an important change — is written without a heading and placed at the top of the page.
There used to be a separate :::banner block for this. It still builds the
same, but docara validate page suggests replacing it with an alert without
a heading (MARKDOWN_PARAMETER_DEPRECATED).
Look
variant changes the density of the styling, not the meaning.
Suits most alerts.
For a calm message.
When you need a lighter accent.
Accessibility
- An alert is a
statusregion named after its heading: screen readers announce it as a separate block. Adangeralert without a heading is analertregion, announced at once. - Colour is not the only carrier of meaning: the icon and the heading both convey the type. Name the situation in words: “Note”, “Fix required”.
- Do not put several alerts in a row: the reader stops noticing them.
Parameters
| Parameter | Values | Default | Sets |
|---|---|---|---|
type |
clear, info, success, warning, danger |
info |
The meaning of the message: clear is neutral, info is information, success is success, warning is a warning, danger is a danger or an error. |
variant |
default, flat, outlined |
default |
The look: default is filled, flat has no shadow, outlined has a border. |
See also
- Details — for additional details
- SIMAI Framework ui.* components — the
ui.alertalert