Interface: ToastOptions\<Data>
services.ToastOptions
Type parameters
Name | Type |
---|---|
Data | {} |
Hierarchy
CommonOptions
↳
ToastOptions
↳↳
ToastProps
Table of contents
Properties
- autoClose
- bodyStyle
- closeOnClick
- containerId
- data
- delay
- draggable
- draggableDirection
- draggablePercent
- hideProgressBar
- icon
- isLoading
- onClick
- onClose
- onOpen
- pauseOnFocusLoss
- pauseOnHover
- position
- progress
- progressStyle
- role
- rtl
- style
- toastId
- type
- updateId
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
CommonOptions.autoClose
Defined in
src/services/toastService.ts:48
bodyStyle
• Optional
bodyStyle: CSSProperties
An optional inline style to apply for the toast content.
Inherited from
CommonOptions.bodyStyle
Defined in
src/services/toastService.ts:64
closeOnClick
• Optional
closeOnClick: boolean
Remove the toast when clicked.
Default: true
Inherited from
CommonOptions.closeOnClick
Defined in
src/services/toastService.ts:42
containerId
• Optional
containerId: string
Set id to handle multiple container
Inherited from
CommonOptions.containerId
Defined in
src/services/toastService.ts:95
data
• Optional
data: Data
Defined in
src/services/toastService.ts:156
delay
• Optional
delay: number
Add a delay in ms before the toast appear.
Defined in
src/services/toastService.ts:154
draggable
• Optional
draggable: boolean
Allow toast to be draggable
Default: true
Inherited from
CommonOptions.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"
Inherited from
CommonOptions.draggableDirection
Defined in
src/services/toastService.ts:85
draggablePercent
• Optional
draggablePercent: number
The percentage of the toast's width it takes for a drag to dismiss a toast
Default: 80
Inherited from
CommonOptions.draggablePercent
Defined in
src/services/toastService.ts:80
hideProgressBar
• Optional
hideProgressBar: boolean
Hide or show the progress bar.
Default: false
Inherited from
CommonOptions.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
CommonOptions.icon
Defined in
src/services/toastService.ts:112
isLoading
• Optional
isLoading: boolean
Defined in
src/services/toastService.ts:155
onClick
• Optional
onClick: (event
: MouseEvent
\<Element
, MouseEvent
>) => void
Type declaration
▸ (event
): void
Parameters
Name | Type |
---|---|
event | MouseEvent \<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
CommonOptions.onClick
Defined in
src/services/toastService.ts:102
onClose
• Optional
onClose: \<T>(props
: T
) => void
Type declaration
▸ \<T
>(props
): void
Type parameters
Name | Type |
---|---|
T | {} |
Parameters
Name | Type |
---|---|
props | T |
Returns
void
Deprecated
⚠️ Will be removed in the next major release. You can rely on toast.onChange
instead.
Called when toast is unmounted.
Defined in
src/services/toastService.ts:129
onOpen
• Optional
onOpen: \<T>(props
: T
) => void
Type declaration
▸ \<T
>(props
): void
Type parameters
Name | Type |
---|---|
T | {} |
Parameters
Name | Type |
---|---|
props | T |
Returns
void
Deprecated
⚠️ Will be removed in the next major release. You can rely on toast.onChange
instead.
Called when toast is mounted.
Defined in
src/services/toastService.ts:122
pauseOnFocusLoss
• Optional
pauseOnFocusLoss: boolean
Pause the toast when the window loses focus.
Default: true
Inherited from
CommonOptions.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
CommonOptions.pauseOnHover
Defined in
src/services/toastService.ts:32
position
• Optional
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'
Inherited from
CommonOptions.position
Defined in
src/services/toastService.ts:54
progress
• Optional
progress: string
| number
Set the percentage for the controlled progress bar. Value must be between 0 and 1.
Defined in
src/services/toastService.ts:150
progressStyle
• Optional
progressStyle: CSSProperties
An optional style to set for the progress bar.
Inherited from
CommonOptions.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
CommonOptions.role
Defined in
src/services/toastService.ts:91
rtl
• Optional
rtl: boolean
Support right to left display.
Default: false
Inherited from
CommonOptions.rtl
Defined in
src/services/toastService.ts:107
style
• Optional
style: CSSProperties
An optional inline style to apply.
Defined in
src/services/toastService.ts:133
toastId
• Optional
toastId: string
Set a custom toastId
Defined in
src/services/toastService.ts:142
type
• Optional
type: TypeOptions
Set the toast type.
One of: 'info', 'success', 'warning', 'error', 'default'
Defined in
src/services/toastService.ts:138
updateId
• Optional
updateId: string
Used during update