Reference machines
toast
interface 3 type 5 function 1
# CreateToastInput
Members
defaultDuration?optional defaultDuration?: numberDefault 5000ms.
initial?optional initial?: ToastItem[]Initial toasts — useful for SSR hydration.
max?optional max?: numberDefault 5; oldest dropped when full. Use Infinity to disable trim.
# ToastContext
Members
defaultDurationdefaultDuration: numberDefault duration applied to ADDs that omit it.
maxmax: numberHard limit; older toasts dropped from the front when exceeded.
toaststoasts: readonly ToastItem[]
# ToastItem
Members
description?optional description?: stringduration?optional duration?: numberAuto-dismiss delay in ms. -1 (or Infinity) = sticky. Default 5000.
idid: stringStable identifier — caller-supplied or generated by Layer 3.
meta?optional meta?: Record<string, unknown>Free-form metadata — passed back to the consumer's render.
politeness?optional politeness?: ToastPolitenesstitletitle: stringtype?optional type?: ToastType
# ToastEvent
# ToastMachine
ToastMachine = Machine<ToastContext, ToastEvent, ToastState># ToastPoliteness
ToastPoliteness = "polite" | "assertive"ARIA-live politeness; mapped to aria-live on the toast wrapper.
# ToastState
ToastState = "idle"# ToastType
ToastType = "info" | "success" | "warning" | "error"# createToastMachine ( )
createToastMachine(input?): ToastMachineConstruct a fresh Toast (toaster) machine.
Parameters
input?CreateToastInput = {}
Returns
ToastMachine