tsimport {useToast} from '@astryxdesign/core/Toast'
| Guidance | Practices |
|---|---|
| Do | Use for transient success/error feedback that does not require user action. |
| Do | Set uniqueID to deduplicate toasts from rapid user actions. |
| Don't | Use for critical errors that require acknowledgment; use AlertDialog instead. |
| Don't | Call useToast in the same component that renders LayerProvider; it must be called from a child component inside the provider. |
| Field | Type | Description |
|---|---|---|
| showToast | (options: ToastOptions) => () => void | Show a toast notification. Returns a dismiss function. Options include body (ReactNode), type ("info" | "error"), isAutoHide, autoHideDuration, endContent, uniqueID, and collisionBehavior. |