React Strawberry Toast
  • Getting Started
  • Guides
      Show ToastCustomizeStylingPositioningMulti ContainerHeadless Hook
  • API
      toastContainertoastuseToasts
  • Getting Started
  • Guides
      Show ToastCustomizeStylingPositioningMulti ContainerHeadless Hook
  • API
      toastContainertoastuseToasts

toast()

API reference

The table below shows the properties of second parameters of toast function


OptionDescriptionTypeDefault
toastIdToast's unique IdString
positionPosition per toasttop-left, top-center, top-right, bottom-left, bottom-center, bottom-righttop-center
containerIdID shown in the Toast Container Unique IDString
pauseOnHoverOption that sets the timer to stop or not when a hover event occursBooleantrue
iconThe icon to be displayed in the toastReactNode
timeOutTime for toast to disappearNumber3000
removeTimeOutTime for toast to remove In Toast ListNumber200
classNameClass of toastString
styleStyle of toastObject
targetTarget element where toast will be locatedObject
closeButtonOption to show or hide the close buttonBooleanfalse

handler

MethodDescription
toast.setActiveSets the toast to an active state.
toast.isActiveGet the active state of the toast.
toast.disappearDisappear the toast after a specified time.
toast.pausePause the toast timer.
toast.resumeResume the toast timer.
toast.replaceReplaces the data to be rendered for the toast.
toast.removeRemoves the toast from the list 200ms after it disappears.
toast.allClearRemoves all toasts.
@Created by dkpark10