Config

Configure defaults for every toast with toast.config(partial). Optional framework <Toaster /> wrappers accept the same keys as props.

KeyTypeDefaultDescription
positionToastPosition"top-right"Default stack corner. Per-toast position overrides
theme"light" | "dark" | "system""light"Color scheme
durationnumber4000Default auto-close ms when autoClose is true
autoClosebooleantrueDefault automatic dismissal
closeButtonbooleantrueShow close button by default
dismissiblebooleantrueAllow dismiss by default
richColorsbooleanfalseDefault tinted success/error/warning/info surfaces. Per-toast richColors overrides
visibleToastsnumber3Max visible in the stack
expandbooleanfalseAlways expand stack (else expand on hover)
gapnumber12Gap between expanded toasts (px)
offsetnumber | string16Distance from viewport edge
dir"ltr" | "rtl" | "auto""auto"Text direction
pauseOnHoverbooleantruePause timers while hovering the stack
resetTimerOnHoverbooleanfalseReset timer and progress together on hover
pauseOnWindowBlurbooleantruePause timers when the window loses focus
progressBarbooleantrueShow duration progress bar when auto-closing
toasterClassNamestring-Class on the toaster container
styleobject-Inline styles on the toaster container
toast.config({
  position: "top-right",
  theme: "light",
  duration: 4000,
  autoClose: true,
  richColors: true,
  visibleToasts: 3,
  expand: false,
  progressBar: true,
  pauseOnHover: true,
  resetTimerOnHover: false,
});

autoClose decides whether a toast auto-dismisses. Prefer autoClose: false for sticky toasts instead of duration: Infinity.