Toast
UI SDK toasts: ToastStack renders a styled, announced region with a tone icon per type; toast() and createToaster() add toasts with actions, cancel and timed dismissal.
Example
toast-demo.tsxCopy code
Installation
Copy code
Usage
ImportCopy code
API reference
ToastRegion
| Prop | Type | Default |
|---|---|---|
hoverDelayHow long the pointer has to rest on the toasts, in ms, before their timers pause. Focus pauses them at once. | number | 300 |
Also takes every prop of UI SDK ToastRegion.
Toast
| Prop | Type | Default |
|---|---|---|
toneWhat the toast means. Defaults to the tone of its type, so `toast.error()` reads as destructive. | Tone | – |
Also takes every prop of UI SDK Toast.
ToastTitle
ToastDescription
ToastAction
Takes every prop of UI SDK ToastAction except aria-label, ButtonLookProps.
ToastClose
Takes every prop of UI SDK ToastClose except aria-label, ButtonLookProps.
ToastIcon
| Prop | Type | Default |
|---|---|---|
typeThe toast's type: `loading` shows a spinner, and the others the icon of their tone. | ToastType | "default" |
toneOverrides the tone of the type. `neutral` and `violet` have no icon. | Tone | – |
Also takes <span> attributes except children.
ToastStack
| Prop | Type | Default |
|---|---|---|
hoverDelayHow long the pointer has to rest on the toasts, in ms, before their timers pause. Focus pauses them at once. | number | – |
labelsAccessible names, in the page's language. | Partial<ToastStackLabels> | – |
closeLabel@deprecated Use `labels.close`. | string | – |
Also takes every prop of UI SDK ToastRegion except children.
Other exports
createToastertoasttoastTonetype ToastIconPropstype ToastPropstype ToastRegionPropstype ToastStackLabelstype ToastStackPropsAccessibility
- An announced region in the top layer; actions are real buttons and toasts pause on hover and focus.
Agent actions
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.