Toastflow
Playground
API

Events

Subscribe to toast lifecycle events for analytics, debugging, and UI reactions.

Toastflow emits lightweight events through subscribeEvents.

Event types are defined in packages/core/src/types.ts — look for ToastEvent and ToastEventKind.

Subscribe

const off = toast.subscribeEvents((event) => {
  console.log(event.kind, event.id);
});

off();

Event Kinds

KindEmitted when
duplicateshow(...) found an existing match while preventDuplicates: true
timer-resetVisible toast timer was reset (update or resume with pauseStrategy: "reset")
updateupdate(id, options) succeeded

Behavior Notes

Typical Uses

  • Trigger CSS bump or progress reset animations
  • Analytics and telemetry for notification flows
  • Debug queue and timer behavior during development
Copyright © 2026