Newer Version Available

This content describes an older version of this product. View Latest

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.

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.

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 Indicates that a component has been double-clicked.
mouseover COMPONENT Indicates that the user has moved the mouse pointer over the component.
mouseout COMPONENT Indicates that the user has moved the mouse pointer away from the component.
mouseup COMPONENT Indicates that the user has released the mouse button.
mousemove COMPONENT Indicates that the user has moved the mouse pointer.
click COMPONENT Indicates that a component has been clicked.
mousedown COMPONENT Indicates that the user has pressed a mouse key.