The message component is a static bar that indicates, through prevailing icons and colors, some state to the user.
npm install sling-web-component-message
<sling-message></sling-message>
- sling-framework
- sling-helpers
Name | Type | Default Values | ReflectToAttribute | Observer | callSdk |
---|---|---|---|---|---|
srcdata | String | ✔️ | |||
aim | String | ✔️ |
Name | Description |
---|---|
srcdata | This is the message that will be shown in the component |
aim | Defines the message objective, can be danger , success or warning . |
This component have no event.
All component examples can be emulated using the npm start sling-web-component-message
command.
<sling-message aim="error"></sling-message>
<sling-message aim="success"></sling-message>
<sling-message aim="alert"></sling-message>
<sling-message aim="standby"></sling-message>
<script>
srcdata = ['Some message.', 'Some other message.'];
const components = Array.from(document.querySelectorAll('sling-message'));
components.map(component => component.srcdata = srcdata);
</script>