@tauri-apps/plugin-positioner
Move the window to well-known positions, including positions relative to the tray icon.
Enumerations
Section titled “Enumerations”Position
Section titled “Position”Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L18
Well known window positions.
Enumeration Members
Section titled “Enumeration Members”BottomCenter
Section titled “BottomCenter”BottomCenter: 5;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L30
Bottom center of the screen.
BottomLeft
Section titled “BottomLeft”BottomLeft: 2;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L24
Bottom left corner of the screen.
BottomRight
Section titled “BottomRight”BottomRight: 3;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L26
Bottom right corner of the screen.
Center
Section titled “Center”Center: 8;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L36
Center of the screen.
LeftCenter
Section titled “LeftCenter”LeftCenter: 6;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L32
Vertically centered on the left edge of the screen.
RightCenter
Section titled “RightCenter”RightCenter: 7;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L34
Vertically centered on the right edge of the screen.
TopCenter
Section titled “TopCenter”TopCenter: 4;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L28
Top center of the screen.
TopLeft
Section titled “TopLeft”TopLeft: 0;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L20
Top left corner of the screen.
TopRight
Section titled “TopRight”TopRight: 1;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L22
Top right corner of the screen.
TrayBottomCenter
Section titled “TrayBottomCenter”TrayBottomCenter: 14;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L66
Directly below the tray icon, horizontally centered on it. Requires the tray-icon feature
and the tray icon’s events to be forwarded through handleIconState.
TrayBottomLeft
Section titled “TrayBottomLeft”TrayBottomLeft: 10;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L46
Directly below the tray icon, aligned with its left edge. Requires the tray-icon feature
and the tray icon’s events to be forwarded through handleIconState.
TrayBottomRight
Section titled “TrayBottomRight”TrayBottomRight: 12;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L56
Directly below the tray icon, aligned with its right edge. Requires the tray-icon feature
and the tray icon’s events to be forwarded through handleIconState.
TrayCenter
Section titled “TrayCenter”TrayCenter: 13;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L61
Above the tray icon, horizontally centered on it. Requires the tray-icon feature and the
tray icon’s events to be forwarded through handleIconState.
TrayLeft
Section titled “TrayLeft”TrayLeft: 9;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L41
Above the tray icon, aligned with its left edge. Requires the tray-icon feature and the
tray icon’s events to be forwarded through handleIconState.
TrayRight
Section titled “TrayRight”TrayRight: 11;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L51
Above the tray icon, aligned with its right edge. Requires the tray-icon feature and the
tray icon’s events to be forwarded through handleIconState.
Functions
Section titled “Functions”handleIconState()
Section titled “handleIconState()”function handleIconState(event): Promise<void>;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L135
Reports the tray icon’s current position and size so the Tray* Position variants
can be resolved.
This is an internal helper meant to be called from the tray icon’s event handler (the
action callback passed to TrayIcon.new()), forwarding every TrayIconEvent it
receives so that moveWindow and moveWindowConstrained can later position the
window relative to the tray icon.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
event |
TrayIconEvent |
The tray icon event to read the position and size from. |
Returns
Section titled “Returns”Promise<void>
Example
Section titled “Example”import { handleIconState } from '@tauri-apps/plugin-positioner'import { TrayIcon, type TrayIconEvent } from '@tauri-apps/api/tray'
const action = async (event: TrayIconEvent) => { await handleIconState(event)}
const tray = await TrayIcon.new({ id: 'main', action })2.0.0
moveWindow()
Section titled “moveWindow()”function moveWindow(to): Promise<void>;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L83
Moves the Window to the given Position using WindowExt.move_window()
All positions are relative to the current screen.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
to |
Position |
The Position to move to. |
Returns
Section titled “Returns”Promise<void>
Example
Section titled “Example”import { moveWindow, Position } from '@tauri-apps/plugin-positioner'
await moveWindow(Position.TopRight)2.0.0
moveWindowConstrained()
Section titled “moveWindowConstrained()”function moveWindowConstrained(to): Promise<void>;Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L105
Moves the Window to the given Position using WindowExt.move_window_constrained()
This move operation constrains the window to the screen dimensions in case of tray-icon positions.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
to |
Position |
The (tray) Position to move to. |
Returns
Section titled “Returns”Promise<void>
Example
Section titled “Example”import { moveWindowConstrained, Position } from '@tauri-apps/plugin-positioner'
await moveWindowConstrained(Position.TrayCenter)2.1.0
© 2026 Tauri Contributors. CC-BY / MIT