Skip to main content

Interface: ToastProps

services.ToastProps

Hierarchy

Table of contents

Properties

Properties

autoClose

Optional autoClose: number | false

Set the delay in ms to close the toast automatically. Use false to prevent the toast from closing. Default: 5000

Inherited from

ToastOptions.autoClose

Defined in

src/services/toastService.ts:48


bodyStyle

Optional bodyStyle: CSSProperties

An optional inline style to apply for the toast content.

Inherited from

ToastOptions.bodyStyle

Defined in

src/services/toastService.ts:64


children

Optional children: ToastContent\<unknown>

Defined in

src/services/toastService.ts:166


closeOnClick

Optional closeOnClick: boolean

Remove the toast when clicked. Default: true

Inherited from

ToastOptions.closeOnClick

Defined in

src/services/toastService.ts:42


closeToast

closeToast: () => void

Type declaration

▸ (): void

Returns

void

Defined in

src/services/toastService.ts:164


containerId

Optional containerId: string

Set id to handle multiple container

Inherited from

ToastOptions.containerId

Defined in

src/services/toastService.ts:95


data

Optional data: Object

Inherited from

ToastOptions.data

Defined in

src/services/toastService.ts:156


delay

Optional delay: number

Add a delay in ms before the toast appear.

Inherited from

ToastOptions.delay

Defined in

src/services/toastService.ts:154


deleteToast

deleteToast: () => void

Type declaration

▸ (): void

Returns

void

Defined in

src/services/toastService.ts:169


draggable

Optional draggable: boolean

Allow toast to be draggable Default: true

Inherited from

ToastOptions.draggable

Defined in

src/services/toastService.ts:75


draggableDirection

Optional draggableDirection: DraggableDirection

Specify in which direction should you swipe to dismiss the toast Default: "x"

Overrides

ToastOptions.draggableDirection

Defined in

src/services/toastService.ts:168


draggablePercent

draggablePercent: number

The percentage of the toast's width it takes for a drag to dismiss a toast Default: 80

Overrides

ToastOptions.draggablePercent

Defined in

src/services/toastService.ts:167


hideProgressBar

Optional hideProgressBar: boolean

Hide or show the progress bar. Default: false

Inherited from

ToastOptions.hideProgressBar

Defined in

src/services/toastService.ts:69


icon

Optional icon: ToastIcon

Used to display a custom icon. Set it to false to prevent the icons from being displayed

Inherited from

ToastOptions.icon

Defined in

src/services/toastService.ts:112


iconOut

Optional iconOut: ReactNode

Defined in

src/services/toastService.ts:171


isIn

isIn: boolean

Defined in

src/services/toastService.ts:160


isLoading

Optional isLoading: boolean

Inherited from

ToastOptions.isLoading

Defined in

src/services/toastService.ts:155


key

key: string

Defined in

src/services/toastService.ts:163


onClick

Optional onClick: (event: MouseEvent\<Element, MouseEvent>) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMouseEvent\<Element, MouseEvent>
Returns

void

Deprecated

⚠️ Will be removed in the next major release. You can pass a react component with you handler instead.

Fired when clicking inside toaster

Inherited from

ToastOptions.onClick

Defined in

src/services/toastService.ts:102


onClose

Optional onClose: \<T>(props: T) => void

Type declaration

▸ \<T>(props): void

Type parameters
NameType
T{}
Parameters
NameType
propsT
Returns

void

Deprecated

⚠️ Will be removed in the next major release. You can rely on toast.onChange instead.

Called when toast is unmounted.

Inherited from

ToastOptions.onClose

Defined in

src/services/toastService.ts:129


onOpen

Optional onOpen: \<T>(props: T) => void

Type declaration

▸ \<T>(props): void

Type parameters
NameType
T{}
Parameters
NameType
propsT
Returns

void

Deprecated

⚠️ Will be removed in the next major release. You can rely on toast.onChange instead.

Called when toast is mounted.

Inherited from

ToastOptions.onOpen

Defined in

src/services/toastService.ts:122


pauseOnFocusLoss

Optional pauseOnFocusLoss: boolean

Pause the toast when the window loses focus. Default: true

Inherited from

ToastOptions.pauseOnFocusLoss

Defined in

src/services/toastService.ts:37


pauseOnHover

Optional pauseOnHover: boolean

Pause the timer when the mouse hover the toast. Default: true

Inherited from

ToastOptions.pauseOnHover

Defined in

src/services/toastService.ts:32


position

position: ToastPosition

Set the default position to use. One of: 'top-right', 'top-center', 'top-left', 'bottom-right', 'bottom-center', 'bottom-left' Default: 'top-right'

Overrides

ToastOptions.position

Defined in

src/services/toastService.ts:165


progress

Optional progress: string | number

Set the percentage for the controlled progress bar. Value must be between 0 and 1.

Inherited from

ToastOptions.progress

Defined in

src/services/toastService.ts:150


progressStyle

Optional progressStyle: CSSProperties

An optional style to set for the progress bar.

Inherited from

ToastOptions.progressStyle

Defined in

src/services/toastService.ts:59


role

Optional role: string

Define the ARIA role for the toast Default: alert https://www.w3.org/WAI/PF/aria/roles

Inherited from

ToastOptions.role

Defined in

src/services/toastService.ts:91


rtl

Optional rtl: boolean

Support right to left display. Default: false

Inherited from

ToastOptions.rtl

Defined in

src/services/toastService.ts:107


staleId

Optional staleId: string

Defined in

src/services/toastService.ts:161


style

Optional style: CSSProperties

An optional inline style to apply.

Inherited from

ToastOptions.style

Defined in

src/services/toastService.ts:133


toastId

toastId: string

Set a custom toastId

Overrides

ToastOptions.toastId

Defined in

src/services/toastService.ts:162


type

type: TypeOptions

Set the toast type. One of: 'info', 'success', 'warning', 'error', 'default'

Overrides

ToastOptions.type

Defined in

src/services/toastService.ts:170


updateId

Optional updateId: string

Used during update

Inherited from

ToastOptions.updateId

Defined in

src/services/toastService.ts:146