$ rezi
Widgets

Toast

Transient notification UI anchored to a screen edge.

Transient notification UI anchored to a screen edge.

Usage

ui.toastContainer({
  toasts: state.toasts,
  position: "bottom-right",
  maxVisible: 5,
  onClose: (id) =>
    app.update((s) => ({ ...s, toasts: s.toasts.filter((t) => t.id !== id) })),
})

Props

PropTypeDefaultDescription
toastsToast[]requiredActive toasts
positionToastPosition"bottom-right"Container position
maxVisiblenumber5Max visible toasts
widthnumber40Toast container width in cells (clamped to viewport width)
frameStyle{ background?, foreground?, border? }-Optional frame/surface colors for toast background, message text, and border
onClose(id) => voidrequiredDismiss callback

Mouse Behavior

Toast action buttons (e.g., "Undo") can be clicked with the mouse to trigger their onAction callback.

Overlay stacking

Toast containers register in the shared LayerRegistry, so toast z-order is managed by the same overlay system as modals and dropdowns.

Container height is derived from maxVisible * toastHeight and clamped to viewport height.

Toast shape

  • id: unique toast identifier
  • message: message text
  • type: "info" | "success" | "warning" | "error"
  • duration: auto-dismiss ms (0 = persistent, default: 3000)
  • action: optional { label, onAction }
  • progress: optional 0–100 value

ToastPosition values: "top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right".

On this page