Skip to content

TrayIconOptions

Module @netwiv/api/tray · Kind Interface

import { TrayIconOptions } from '@netwiv/api/tray';
action?: ((event: TrayIconEvent) => void) | undefined

A handler for an event on the tray icon.

icon?: string | number[] | Image | ArrayBuffer | Uint8Array<ArrayBufferLike> | undefined

The tray icon which could be icon bytes or path to the icon file.

Note that you may need the image-ico or image-png Cargo features to use this API. To enable it, change your Cargo.toml file:

[dependencies]
tauri = { version = "...", features = ["...", "image-png"] }
iconAsTemplate?: boolean | undefined

Use the icon as a template. macOS only.

id?: string | undefined

The tray icon id. If undefined, a random one will be assigned

menu?: Menu | Submenu | undefined
menuOnLeftClick?: boolean | undefined

Whether to show the tray menu on left click or not, default is true.

  • Linux: Unsupported.

Deprecated use {@linkcode TrayIconOptions.showMenuOnLeftClick} instead.

showMenuOnLeftClick?: boolean | undefined

Whether to show the tray menu on left click or not, default is true.

  • Linux: Unsupported.
tempDirPath?: string | undefined

The tray icon temp dir path. Linux only.

On Linux, we need to write the icon to the disk and usually it will be $XDG_RUNTIME_DIR/tray-icon or $TEMP/tray-icon.

title?: string | undefined

The tray title

  • Linux: The title will not be shown unless there is an icon as well. The title is useful for numerical and other frequently updated information. In general, it shouldn’t be shown unless a user requests it as it can take up a significant amount of space on the user’s panel. This may not be shown in all visualizations.
  • Windows: Unsupported.
tooltip?: string | undefined

The tray icon tooltip


Descriptions come from the pinned @tauri-apps/api@2.11.1 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.