Changes from V1:
alertRole, alertDialogRole role attributesBannerAttribute -> AttributeAttributes on any Message typemapContentplaintext, markdown, and html Attribute helpers instead of having Content(..) in the view APIsAttribute helpers instead of having Theme(..) in the view APIsview function (tiny, large, and banner are now Attributes)alertRole in somethingWentWrongview =
Message.view
[ Message.tip
, Message.markdown "Don't tip too much, or your waitress will **fall over**!"
]Construct an Attribute using a helper like onDismiss or alert.
Shows a tiny alert message. We commonly use these for validation errors and small hints to users.
Message.view [ Message.tiny ]This is the default size for a Message.
Shows a large alert or callout message. We commonly use these for highlighted tips, instructions, or asides in page copy.
Message.view [ Message.large ]Shows a banner alert message. This is even more prominent than Message.large.
We commonly use these for flash messages at the top of pages.
Message.view [ Message.banner ]Use this attribute when a user's immediate attention on the Message is required.
For example, use this attribute when:
- An invalid value was entered into a form field
- The user's login session is about to expire
- The connection to the server was lost, local changes will not be saved
-- Excerpted from Using the alert role MDN docs
Use this attribute when (1) a user's immediate attention on the Message is required, (2) the Message contains interactible elements, and (3) you've correctly set up the Message to be modal (i.e., you've set up tab-wrapping, the body's overflow is hidden, the user can't interact with elements apart from the Message's contents...)
When you use this role, verify that you are using it correctly using this MDN article.
Shows an appropriate error message for when something unhandled happened.