Skip to content

Alert

Alert components are Display Fields to display contextual feedback messages for user actions or system events.

alert.json
{
"form": {
"uid": "",
"kind": "layout",
"widget": "stack",
"children": [
{
"uid": "",
"kind": "display",
"widget": "alert",
"props": {
"text": "Some fields need your attention"
}
}
]
}
}

Use this props to customize your Alert component.

proptypevalue
textstringMANDATORY The message to display
levelstringDefines the type of alert to display (success, warning, error, info), if no level is set, default is the level

Use the property level to determines the tone and appearance of the alert.

alert.json
{
"form": {
"uid": "",
"kind": "layout",
"widget": "stack",
"children": [
{
"uid": "",
"kind": "display",
"widget": "alert",
"props": {
"text": "Default level",
"level": "default"
}
},
{
"uid": "",
"kind": "display",
"widget": "alert",
"props": {
"text": "Info level",
"level": "info"
}
},
{
"uid": "",
"kind": "display",
"widget": "alert",
"props": {
"text": "Success level",
"level": "success"
}
},
{
"uid": "",
"kind": "display",
"widget": "alert",
"props": {
"text": "Warning level",
"level": "warning"
}
},
{
"uid": "",
"kind": "display",
"widget": "alert",
"props": {
"text": "Error level",
"level": "error"
}
}
]
}
}

Textinputs can be styled as explained in the Styling Guide.

Following you will find a list with the CSS Variables and a quick description of what you will style.

CSS VariableDescription
--gui-color-default--lightBackground color for default level
--gui-color-defaultBorder color for default level
--gui-color-default--darkFont color for default level
--gui-color-info--lightBackground color for info level
--gui-color-infoBorder color for info level
--gui-color-info--darkFont color for info level
--gui-color-success--lightBackground color for success level
--gui-color-successBorder color for success level
--gui-color-success--darkFont color for success level
--gui-color-warning--lightBackground color for warning level
--gui-color-warningBorder color for warning level
--gui-color-warning--darkFont color for warning level
--gui-color-error--lightBackground color for error level
--gui-color-errorBorder color for error level
--gui-color-error--darkFont color for error level

This is the anatomy of the Alert Component in case you want to use your CSS styles.

alert.html
<gui-alert>
<div class="gui-field" id="fieldUid">
<div class="gui-alert-notification gui-alert-notification--default">Alert text</div>
</div>
</gui-alert>