diff --git a/src/views/toast/ToastDoc.vue b/src/views/toast/ToastDoc.vue index cffd46cef..684bcfdef 100644 --- a/src/views/toast/ToastDoc.vue +++ b/src/views/toast/ToastDoc.vue @@ -2,14 +2,30 @@
Toast messages are dynamically created using a ToastService that needs to be installed globally before the application + instance is created.
+Ideal location of a Toast is the main application template so that it can be used by any component within the application.
+A single message is represented by the Message interface in PrimeVue that defines various properties such as severity, - summary and detail. Messages are displayed by using the add method on the ref of the Toast instance.
+ summary and detail. Messages are displayed by using the add method of the $toast property of the application.Name | -Type | -Default | -Description | -
---|---|---|---|
Name | +Type | +Default | +Description | +
severity | -string | -null | -Severity of the message. | -
summary | -element | -null | -Summary content of the message. | -
detail | -element | -null | -Detail content of the message. | -
closable | -boolean | -true | -Whether the message can be closed manually using the close icon. | -
sticky | -element | -null | -When enabled, message is not removed automatically. | -
life | -number | -3000 | -Delay in milliseconds to close the message automatically. | -
severity | +string | +null | +Severity of the message. | +
summary | +element | +null | +Summary content of the message. | +
detail | +element | +null | +Detail content of the message. | +
closable | +boolean | +true | +Whether the message can be closed manually using the close icon. | +
sticky | +element | +null | +When enabled, message is not removed automatically. | +
life | +number | +3000 | +Delay in milliseconds to close the message automatically. | +
group | +string | +null | +Key of the Toast to display the message. | +
Name | +Type | +Default | +Description | +
---|---|---|---|
add | +message: Message instance | +Displays the message in a suitable Toast component. | +|
removeGroup | +group: Name of the message group | +Clears the messages that belongs to the group. | +|
removeAllGroup | +- | +Clears all the messages. | +
There are four possible values for the severity of a message.
+There are four possible values for the severity of a message. Info is the default.
Show method accepts either a single message or an array of messages.
-There are four positions available for the toast container defined by the position property that defaults to "topright". Other valid values are "topleft", "bottomleft" and "bottomright"
-A message can be targeted to a specific Toast component if their group properties match. Messages without a group + are forwarded to the default Toast component that does not have a group defined. +
+ +removeAllGroups() method removes all messages from Toast.
+removeGroup(group) clears the messages for a specific Toast whereas removeAllGroups() method clears all messages.
Name | -Type | -Default | -Description | -
---|---|---|---|
Name | +Type | +Default | +Description | +
group | -string | -null | -??? | -
position | -string | -topright | -Position of the toast in viewport, valid values are "topright", "topleft", "bottomleft" and "bottomright". | -
group | +string | +null | +Unique identifier of a message group. | +
position | +string | +topright | +Position of the toast in viewport, valid values are "topright", "topleft", "bottomleft" and "bottomright". | +
Name | -Element | -
---|---|
Name | +Element | +
p-toast | -Main container element. | -
p-toast-container | -Container of a message item. | -
p-toast-item | -Message element. | -
p-toast-icon-close | -Close icon of a message. | -
p-toast-image | -Severity icon. | -
p-toast-message | -Container of message texts. | -
p-toast-title | -Summary of the message. | -
p-toast | +Main container element. | +
p-toast-container | +Container of a message item. | +
p-toast-item | +Message element. | +
p-toast-icon-close | +Close icon of a message. | +
p-toast-image | +Severity icon. | +
p-toast-message | +Container of message texts. | +
p-toast-title | +Summary of the message. | +