Global UI
Overview
This section contains all components and utilities for Global UI.
Components
| Item | Type | Description |
|---|---|---|
| this.ui (UIApi) | Interface | Global UI methods for doing things like showing toast notifications on top of the application window. |
| showToast | Method | Displays a toast notification to the user. |
this.ui (UIApi)
Global UI methods for doing things like showing toast notifications on top of the application window.
showToast
Displays a toast notification to the user.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
duration | number | No | Auto-dismiss duration in milliseconds. Defaults to 3000. |
message | string | Yes | The message to display. |
type | "info" \| "success" \| "warning" \| "error" | No | Visual style of the toast. Defaults to "info". |
Example
typescript
// Success notification
await this.ui.showToast({
message: 'Settings saved successfully!',
type: 'success',
duration: 3000
});
// Error notification
await this.ui.showToast({
message: 'Failed to connect to server',
type: 'error',
duration: 5000
});
// Warning notification
await this.ui.showToast({
message: 'This feature is experimental',
type: 'warning'
});
// Info notification (default)
await this.ui.showToast({
message: 'Processing your request...',
type: 'info'
});