Types
TypeScript definitions for react-toast-msg.
react-toast-msg is built with TypeScript and provides first-class type definitions.
ToastType
typescript1export type ToastType = 'success' | 'error' | 'warning' | 'default';
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. |
ToastContainerProps
Props accepted by the ToastContainer component.
| Props | Type | Default | Description |
|---|---|---|---|
| autoClose | number | 3000 | Global default duration for auto-closing toasts. |
| closeButton | boolean | false | Whether to show a close button on all toasts by default. |
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 February 17, 2026