Types
TypeScript definitions for react-toast-msg.
react-toast-msg is built with TypeScript and provides first-class type definitions.
ToastType
typescript
ToastOptions
Used when triggering a toast (internally or via future API extensions).
| Props | Type | Default | Description |
|---|---|---|---|
| type | ToastType | 'default' | The style of the toast. |
| duration | number | 3000 | Time in ms before auto-close. |
| closeButton | boolean | false | Whether to show a close button on all toasts by default. |
| autoClose | boolean | number | - |
| pauseOnHover | boolean | true | Pause the auto-close timer while the toast is hovered. |
ToastContainerProps
Props accepted by the ToastContainer component.
| Props | Type | Default | Description |
|---|---|---|---|
| autoClose | number | boolean | 3000 |
| closeButton | boolean | false | Whether to show a close button on all toasts by default. |
| pauseOnHover | boolean | true | Pause the auto-close timer while any hovered toast remains visible. |
ShowToastFn
The signature for the toast function.
| Props | Type | Default | Description |
|---|---|---|---|
| message | string | - | The message to display. |
| type | ToastType | 'default' | The style of the toast. |
| duration | number | 3000 | Time in ms before auto-close. |
How is this guide?
Last updated on April 22, 2026