Constructor
JavaScript:
-
new Coral.Alert()
ordocument.createElement('coral-alert')
HTML Tag:
-
<coral-alert>
Extends
Sub-components
Static Properties
-
Coral.Alert.size {String}
-
Properties:
Name Type Value Description SMALL String S A small alert, usually employed for single line alerts without headers. LARGE String L A large alert, usually employed for multi-line alerts with headers. -
Coral.Alert.variant {String}
-
Properties:
Name Type Value Description ERROR String error An alert with a red header and warning icon, indicating that an error has occurred. WARNING String warning An alert with an orange header and warning icon, notifying the user of something important. SUCCESS String success An alert with a green header and checkmark icon, indicates to the user that an operation was successful. HELP String help An alert with a blue header and question mark icon, provides the user with help. INFO String info An alert with a blue header and info icon, informs the user of non-critical information.
Enumeration representing alert sizes.
Enumeration representing alert variants.
Instance Properties
-
instance.content {HTMLElement}
-
-
instance.footer {HTMLElement}
-
-
instance.header {HTMLElement}
-
-
instance.hidden {Boolean}
Reflected -
- Inherited From:
- Default Value:
- false
- HTML Attribute:
- hidden
-
instance.size {Coral.Alert.size}
Reflected -
- Default Value:
- Coral.Alert.size.SMALL
- HTML Attribute:
- size
-
instance.variant {Coral.Alert.variant}
Reflected -
- Default Value:
- Coral.Alert.variant.INFO
- HTML Attribute:
- variant
The alert content element.
The alert footer element.
The alert header element.
Whether this component is hidden or not.
The size of the alert. It accepts both lower and upper case sizes.
The alert variant style to use.
Methods
-
instance.get
-
- Parameters:
-
Name Type Description property String The name of the property to fetch the value of. - Returns:
-
Property value. {*}
- Inherited From:
-
instance.hide
-
- Returns:
-
this, chainable {Coral.Component}
- Inherited From:
-
instance.off
-
- Parameters:
-
Name Type Optional Description eventName String No
The event name to stop listening for. selector String Yes
The selector that was used for event delegation. func function No
The function that was passed to on()
.useCapture Boolean Yes
Only remove listeners with useCapture
set to the value passed in. - Returns:
-
this, chainable. {Coral.Component}
- Inherited From:
-
instance.on
-
- Parameters:
-
Name Type Optional Default Description eventName String No
The event name to listen for. selector String Yes
The selector to use for event delegation. func function No
The function that will be called when the event is triggered. useCapture Boolean Yes
Whether or not to listen during the capturing or bubbling phase. - Returns:
-
this, chainable. {Coral.Component}
- Inherited From:
-
instance.remove
-
- Inherited From:
-
instance.set
-
- Parameters:
-
Name Type Description property String The name of the property to set. value * The value to set the property to. silent Boolean If true, events should not be triggered as a result of this set. - Returns:
-
this, chainable. {Coral.Component}
- Inherited From:
-
instance.show
-
- Returns:
-
this, chainable {Coral.Component}
- Inherited From:
-
instance.trigger
-
- Parameters:
-
Name Type Optional Default Description eventName String No
The event name to trigger. props Object Yes
Additional properties to make available to handlers as event.detail
.bubbles Boolean Yes
Set to false
to prevent the event from bubbling.cancelable Boolean Yes
Set to false
to prevent the event from being cancelable. - Returns:
-
CustomEvent object {CustomEvent}
- Inherited From:
Get the value of a property.
Hide this component.
Remove an event listener.
Add an event listener.
Non-destructively remove this element. It can be re-added by simply appending it to the document again.
It will be garbage collected if there are no more references to it.
Set a single property.
Show this component.
Trigger an event.
Events
-
coral-component:attached
-
- Callback Parameters:
-
Name Type Description event Object Event object.
- Inherited From:
- Deprecated:
- since 1.14.0, use
MutationObserver
instead.
- since 1.14.0, use
-
coral-component:detached
-
- Callback Parameters:
-
Name Type Description event Object Event object.
- Inherited From:
- Deprecated:
- since 1.14.0, use
MutationObserver
instead.
- since 1.14.0, use
-
coral-component:ready
-
- Callback Parameters:
-
Name Type Description event Object Event object.
- Inherited From:
- Deprecated:
- since 1.9.0, use
Coral.commons.ready()
instead.
- since 1.9.0, use
Triggered when the component is attached to the DOM.
Triggered when the component is detached to the DOM.
Triggerred when the component has been upgraded and is ready for use.