Interface: ToastProps
services.ToastProps
Hierarchy
↳
ToastProps
Table of contents
Properties
- autoClose
- bodyStyle
- children
- closeOnClick
- closeToast
- containerId
- data
- delay
- deleteToast
- draggable
- draggableDirection
- draggablePercent
- hideProgressBar
- icon
- iconOut
- isIn
- isLoading
- key
- onClick
- onClose
- onOpen
- pauseOnFocusLoss
- pauseOnHover
- position
- progress
- progressStyle
- role
- rtl
- staleId
- 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
Defined in
src/services/toastService.ts:48
bodyStyle
• Optional bodyStyle: CSSProperties
An optional inline style to apply for the toast content.
Inherited from
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
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
Defined in
src/services/toastService.ts:95
data
• Optional data: Object
Inherited from
Defined in
src/services/toastService.ts:156
delay
• Optional delay: number
Add a delay in ms before the toast appear.
Inherited from
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
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
Defined in
src/services/toastService.ts:167
hideProgressBar
• Optional hideProgressBar: boolean
Hide or show the progress bar.
Default: false
Inherited from
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
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
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
| 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
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.
Inherited from
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.
Inherited from
Defined in
src/services/toastService.ts:122
pauseOnFocusLoss
• Optional pauseOnFocusLoss: boolean
Pause the toast when the window loses focus.
Default: true
Inherited from
Defined in
src/services/toastService.ts:37
pauseOnHover
• Optional pauseOnHover: boolean
Pause the timer when the mouse hover the toast.
Default: true
Inherited from
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
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
Defined in
src/services/toastService.ts:150
progressStyle
• Optional progressStyle: CSSProperties
An optional style to set for the progress bar.
Inherited from
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
Defined in
src/services/toastService.ts:91
rtl
• Optional rtl: boolean
Support right to left display.
Default: false
Inherited from
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
Defined in
src/services/toastService.ts:133
toastId
• toastId: string
Set a custom toastId
Overrides
Defined in
src/services/toastService.ts:162
type
• type: TypeOptions
Set the toast type.
One of: 'info', 'success', 'warning', 'error', 'default'
Overrides
Defined in
src/services/toastService.ts:170
updateId
• Optional updateId: string
Used during update