Skip to content

Global UI ​

Overview ​

This section contains all components and utilities for Global UI.

Components ​

ItemTypeDescription
this.ui (UIApi)InterfaceGlobal UI methods for doing things like showing toast notifications on top of the application window.
showToastMethodDisplays 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 ​

NameTypeRequiredDescription
durationnumberNoAuto-dismiss duration in milliseconds. Defaults to 3000.
messagestringYesThe message to display.
type"info" \| "success" \| "warning" \| "error"NoVisual 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'
});