toast
pb.toast(message, options)
Takes a message string and an options object and creates a default toast with the specified options. A "toast" is a notification that is briefly displayed at the top of the page.
Param | Type | Description |
---|---|---|
message | string | The message to show within the toast |
options | ToastOptions | Toast configuration params |
Methods
success
pb.toast.success(message, options)
Creates a toast styled to indicate that a successful action has been performed.
Param | Type | Description |
---|---|---|
message | string | The message to show within the toast |
options | ToastOptions | Toast configuration params |
warn
pb.toast.warn(message, options)
Creates a toast styled to alert a user with a warning.
Param | Type | Description |
---|---|---|
message | string | The message to show within the toast |
options | ToastOptions | Toast configuration params |
error
pb.toast.error(message, options)
Creates a toast styled to indicate an error on the page.
Param | Type | Description |
---|---|---|
message | string | The message to show within the toast |
options | ToastOptions | Toast configuration params |
info
pb.toast.info(message, options)
Creates a toast styled to emphasize an informal message.
Param | Type | Description |
---|---|---|
message | string | The message to show within the toast |
options | ToastOptions | Toast configuration params |
isActive
pb.toast.isActive(toastId)
Check whether or not a specific toast element is currently displaying.
Param | Type | Description |
---|---|---|
toastId | string | The ID of the toast element |
update
pb.toast.update(toastId, options)
Update the specified toast element with a new configuration.
Param | Type | Description |
---|---|---|
toastId | string | The ID of the toast element |
options | ToastOptions | Toast configuration params |
dismiss
pb.toast.dismiss(toastId)
Dismiss the specified toast element, removing it from view.
Param | Type | Description |
---|---|---|
toastId | string | The ID of the toast element |
ToastOptions
Options for toast functions
Properties
Name | Type | Description |
---|---|---|
autoClose | number | how long before the toast automatically closes |
position | string | the position of the toast on the page |
toastId | string | the ID of the toast element |