$ 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,
  onDismiss: (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
frameStyle{ background?, foreground?, border? }-Optional frame/surface colors for toast background, message text, and border
onDismiss(id) => voidrequiredDismiss callback

Mouse Behavior

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

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