useToasts

useToasts hook that provides a toasty list.
There are two hooks that are basically provided and the other is provided by Headless.

import { useToasts } from 'react-strawberry-toast;'
import { useToasts as useHeadlessToasts } from 'react-strawberry-toast/dist/headless;'

const toasts = useToasts();

The difference between the two hooks is the attribute of the toast item.

Props

The table below shows the item properties table of the list returned from the useToasts hook. Headless hooks don't include position, containerId, pauseOnHover, toastType.

optiondescriptiontypedefault
toastIdToast's unique IdString
dataContent of toastReactNode | () => ReactNode
positionPosition per toast'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'top-center
containerIdID shown in the Toast Container Unique IDString
pauseOnHoverThe Option that sets the timer to stop or not when a hover event occursBooleantrue
toastTypeToast Type'default' | 'custom' | 'success' | 'error' | 'loading' | 'warn'default
createdAtTime that toast was createdDate
timeOutTime for toast to disappearNumber3000
removeTimeOutTime for toast to remove In ListNumber200
updatedWhether the content on toast has changed or notBoolean | nullnull
pausedAtTime for toast to remove In ListDate | nullnull
isVisibleToast exposure status valueBooleantrue