Skip to main content

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.

ParamTypeDescription
messagestringThe message to show within the toast
optionsToastOptionsToast configuration params

Methods

success

pb.toast.success(message, options)

Creates a toast styled to indicate that a successful action has been performed.

ParamTypeDescription
messagestringThe message to show within the toast
optionsToastOptionsToast configuration params

warn

pb.toast.warn(message, options)

Creates a toast styled to alert a user with a warning.

ParamTypeDescription
messagestringThe message to show within the toast
optionsToastOptionsToast configuration params

error

pb.toast.error(message, options)

Creates a toast styled to indicate an error on the page.

ParamTypeDescription
messagestringThe message to show within the toast
optionsToastOptionsToast configuration params

info

pb.toast.info(message, options)

Creates a toast styled to emphasize an informal message.

ParamTypeDescription
messagestringThe message to show within the toast
optionsToastOptionsToast configuration params

isActive

pb.toast.isActive(toastId)

Check whether or not a specific toast element is currently displaying.

ParamTypeDescription
toastIdstringThe ID of the toast element

update

pb.toast.update(toastId, options)

Update the specified toast element with a new configuration.

ParamTypeDescription
toastIdstringThe ID of the toast element
optionsToastOptionsToast configuration params

dismiss

pb.toast.dismiss(toastId)

Dismiss the specified toast element, removing it from view.

ParamTypeDescription
toastIdstringThe ID of the toast element

ToastOptions

Options for toast functions

Properties

NameTypeDescription
autoClosenumberhow long before the toast automatically closes
positionstringthe position of the toast on the page
toastIdstringthe ID of the toast element