Skip to main content
Version: Next

Toast

Notification patterns and full API reference for @editora/toast in the Editora ecosystem.

Installation

npm i @editora/toast
import "@editora/toast/toast.css";
import toast from "@editora/toast";

Quick Start

import toast from "@editora/toast";

toast.success("Document saved");

Usage Patterns

  • Legacy API (toast.info/success/error/warning/loading) for simple notifications.
  • Advanced API (toastAdvanced) for queue management, grouped toasts, plugins, and promise lifecycle.
  • Use theme + position defaults globally with toastAdvanced.configure(...).
import { toastAdvanced } from "@editora/toast";

toastAdvanced.configure({
position: "top-right",
theme: "dark",
maxToasts: 4,
});

const id = toastAdvanced.loading("Export started");
setTimeout(() => toastAdvanced.update(id.id, { message: "Export complete", level: "success" }), 1200);

API Reference

SurfaceTypeNotes
default export: toastLegacy API objectBackward-compatible convenience API
toast.info/success/error/warning/loading(message, optionsOrDuration?, theme?, position?)MethodsLegacy-compatible methods that normalize to modern options
ToastManagerClass exportCore engine for lifecycle, queue, grouping, plugins
toastAdvancedAdvanced API objectFull-featured runtime API
toastProAliasRe-export alias of toastAdvanced
toastAdvanced.show(options)MethodCreate toast with full options
toastAdvanced.update(id, partialOptions)MethodPatch existing toast state
toastAdvanced.dismiss(id) / clear()MethodsRemove one/all toasts
toastAdvanced.promise(promise, options)MethodPromise lifecycle notifications
toastAdvanced.group(groupId, options)MethodGrouped toast streams
toastAdvanced.configure(config)MethodRuntime config merge
toastAdvanced.use(plugin)MethodPlugin registration
toastAdvanced.getToasts/getGroups/getConfigMethodsState inspection
toastAdvanced.onEditorEvent/triggerEditorEventMethodsEditor-event bridge hooks
toastAdvanced.destroy()MethodFull manager teardown
ToastOptionsLegacyTypeBackward-compatible options contract
ToastLevelAdvanced, ToastPosition, ToastThemeTypesCore enums/unions
ToastAction, ToastProgress, ToastContentTypesContent/action contracts
ToastOptionsAdvanced, ToastInstance, ToastConfigTypesRuntime data contracts
ToastPlugin, ToastPromiseOptionsTypesPlugin and promise integration
Animation types (SpringConfig, AnimationType, AnimationConfig, SpringAnimation, BounceAnimation, SlideAnimation, ZoomAnimation, FlipAnimation, FadeAnimation, ElasticAnimation, RotateAnimation, CustomAnimation)TypesAnimation system contracts
Package export @editora/toast/toast.cssCSS entryToast theme and component styling

Best Practices

  • Keep messages short and action-oriented.
  • Use levels consistently (success for completion, warning for recoverable issues, error for blocking failures).
  • Cap concurrent toasts with config to prevent notification overload.

Accessibility

  • Ensure close/dismiss controls are keyboard reachable.
  • Avoid color-only semantics; message text must explain status.
  • Use polite timing and avoid high-frequency toast spam for autosave events.

Performance Notes

  • Reuse one manager instance through exported API.
  • Batch repeated low-priority notifications.
  • Use grouped toasts for recurring task streams (import/export sync) instead of creating independent stacks.