Newer Version Available
ui:message
Represents a message of varying severity levels
The severity attribute indicates a message's severity level and determines the style to use when displaying the message. If the closable attribute is set to true, the message can be dismissed by pressing the × symbol. To apply Lightning Design System styling, we recommend that you use lightning:notificationsLibrary instead of ui:message.
This example shows a confirmation message that can be dismissed.
1<ui:message title="Confirmation" severity="confirm" closable="true">
2 This is a confirmation message.
3 </ui:message>This example shows messages in varying severity levels. To apply Lightning Design System styling, we recommend that you use lightning:notificationsLibrary instead of ui:message.
1<aura:component access="global">
2 <ui:message title="Confirmation" severity="confirm" closable="true">
3 This is a confirmation message.
4 </ui:message>
5 <ui:message title="Information" severity="info" closable="true">
6 This is a message.
7 </ui:message>
8 <ui:message title="Warning" severity="warning" closable="true">
9 This is a warning.
10 </ui:message>
11 <ui:message title="Error" severity="error" closable="true">
12 This is an error message.
13 </ui:message>
14
15</aura:component>Attributes
| Attribute Name | Attribute Type | Description | Required? |
|---|---|---|---|
| body | Component[] | The body of the component. In markup, this is everything in the body of the tag. | |
| class | String | A CSS style to be attached to the component. This style is added in addition to base styles output by the component. | |
| closable | Boolean | Specifies whether to display an 'x' that will close the alert when clicked. Default value is 'false'. | |
| severity | String | The severity of the message. Possible values: message (default), confirm, info, warning, error | |
| title | String | The title text for the message. |
Events
| Event Name | Event Type | Description |
|---|---|---|
| dblclick | COMPONENT | The event fired when the user double-clicks the component. |
| mouseover | COMPONENT | The event fired when the user moves the mouse pointer over the component. |
| mouseout | COMPONENT | The event fired when the user moves the mouse pointer away from the component. |
| mouseup | COMPONENT | The event fired when the user releases the mouse button over the component. |
| mousemove | COMPONENT | The event fired when the user moves the mouse pointer over the component. |
| click | COMPONENT | The event fired when the user clicks on the component. |
| mousedown | COMPONENT | The event fired when the user clicks a mouse button over the component. |