Generates a random long message each time to show wrapping inside the toast width limit.
Shows newline rendering with \n.
Shows a narrower toast by setting maxWidth: 280.
| Option | Type | Default | Description |
|---|---|---|---|
message | string | undefined | Toast message content. Supports multiline text with \n. |
title | string | undefined | Title displayed above the message |
position | ToastPosition | 'top-right' | Position of the toast on screen |
durationMs | number | 4000 | Duration in milliseconds before auto-dismiss |
style | 'outline' | 'dash' | 'soft' | undefined | Visual style variant of the toast |
showCloseButton | boolean | false | Show close button on the toast |
minWidth | number | 250 | Minimum toast width in pixels. Inherits from the Toaster by default. |
maxWidth | number | 420 | Maximum toast width in pixels. Inherits from the Toaster by default. |
customClass | string | undefined | Custom CSS classes to apply |
button | ButtonConfig | undefined | Action button configuration |
| Prop | Type | Default | Description |
|---|---|---|---|
stack | boolean | false | Enable stacked toast display mode |
minWidth | number | 250 | Default minimum width for all toasts in pixels |
maxWidth | number | 420 | Default maximum width for all toasts in pixels |
| Method | Description |
|---|---|
toast(message, options?) | Show a default toast with message |
toast(options) | Show a toast with options object (message inside options) |
toast.success(message, options?) | Show a success toast |
toast.error(message, options?) | Show an error toast |
toast.warning(message, options?) | Show a warning toast |
toast.info(message, options?) | Show an info toast |
toast.loading(message, options?) | Show a loading toast (returns controller) |
Methods available on the returned toast controller (e.g., from toast.loading())
| Method | Description |
|---|---|
t.update(options) | Update the toast with new options |
t.dismiss() | Dismiss the toast manually |
t.success(message, options?) | Update toast to success state |
t.error(message, options?) | Update toast to error state |
t.warning(message, options?) | Update toast to warning state |
t.info(message, options?) | Update toast to info state |
Default: top-right