Toastflow
Playground
API

Actions

Store methods for showing, updating, dismissing, and managing toasts.

Actions are the mutating methods on toast (Vue/Nuxt) or store (headless).

Full method signatures:packages/core/src/store.ts.

Method Overview

MethodPurpose
show(...)Create a toast, returns ToastId
loading(input, config)Bind async flow to loading → success / error
update(id, options)Patch an existing toast
dismiss(id)Dismiss one toast
dismissAll()Dismiss all visible and queued toasts
pause(id)Pause timer for one toast
resume(id)Resume timer using pauseStrategy
pauseQueue()Pause queue processing globally
resumeQueue()Resume queue processing
getState()Current state snapshot
getConfig()Resolved global config
subscribe(listener)Continuous state updates
subscribeEvents(listener)One-off event stream

Typed wrappers: default, success, error, info, warning, custom — they pin the type field automatically.

Create Call Styles

StyleUse when
toast.show({ ... })You already have a full payload object
toast.show(title, opts)The title is the primary thing being shown
toast.success({ ... })The toast type is known at the call site
toast.error(title, opts)You want a typed helper with title + options

See Toasts for runnable examples.

title or description must be non-empty. Empty content throws.

Loading Helper

await toast.loading(new Promise((resolve) => window.setTimeout(resolve, 900)), {
  loading: { title: "Saving" },
  success: { title: "Saved" },
  error: { title: "Failed" },
});

The loading toast uses duration: Infinity and progressBar: false. On resolve/reject, the same toast id transitions to success or error.

For real requests, pass fetch, $fetch, or a function that returns a promise. success and error can also be functions when the final message needs response data.

loading(...) returns the wrapped promise — it rejects when the task fails (the error toast is shown either way). If you fire-and-forget the call, attach a .catch(() => {}) or the rejection surfaces as an unhandled promise rejection.

Try this example

Button mirrors the loading helper example shown above.

Copyright © 2026