lowdefy/packages/docs/actions/Message.yaml
2021-01-13 17:21:27 +02:00

57 lines
1.7 KiB
YAML

_ref:
path: templates/general.yaml.njk
vars:
pageId: MessageAction
pageTitle: Message
section: Actions
content:
- id: markdown
type: Markdown
style:
'.markdown-body':
fontSize: 14px
properties:
content: |
The `Message` action is used to display a message to a user.
### Parameters
- `status`: _Enum_ - Message status type. One of `success`, `error`, `info`, `warning`, or `loading`. Defaults to `success`.
- `duration`: _Number_ - Time in seconds before message disappears. The default is 5.
- `content`: _String_ - The content of the message.
> If the duration is set to zero or null, the message never disappears and cannot be dismissed.
If you need a message that needs to display until dismissed, use the `Notification` action instead.
### Examples
Display a success message:
```
- id: success_message
type: Message
params:
content: Success
```
Display an info message that remains visible for 10 seconds:
```
- id: info_message
type: Message
params:
content: Something happened
status: info
duration: 10
```
Display an error message that never disappears:
```
- id: error_message
type: Message
params:
content: Something bad happened
status: error
duration: 0
```