feedbackcss

Toast

Sonner-style stacked notifications created imperatively through window.zToast, grouped by screen position, with swipe dismissal and promise helpers.

Notes

  • Toasts are created imperatively (zToast.success('Saved')); the toaster group is created on demand and appended to body, so no markup is required. The toast pack exposes window.zToast.
  • Setting href on action or cancel renders a native <a> link (supporting target and rel, defaulting rel to noopener noreferrer for target="_blank") while still running onClick and dismissing unless prevented.
  • Collapsed stacks peek by --z-toaster-peek per item and scale down by 5% per depth; hovering or focusing the group expands it.
  • Auto-dismiss timers pause while the group is expanded or hovered, or the page is hidden; loading toasts never auto-dismiss. Default duration is 4000 ms (danger 6000 ms).
  • Toasts can be swiped away along the group's edge direction; dismissible: false or interactive content under the pointer blocks the swipe.
  • On viewports up to 40rem wide the group spans the viewport with 1rem side offsets.