Skip to content

@tauri-apps/plugin-positioner

Move the window to well-known positions, including positions relative to the tray icon.

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L18

Well known window positions.

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: 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: 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: 8;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L36

Center of the screen.

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: 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: 4;

Source: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/positioner/guest-js/index.ts#L28

Top center of the screen.

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: 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: 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: 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: 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: 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: 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: 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.

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.

Parameter Type Description
event TrayIconEvent The tray icon event to read the position and size from.

Promise<void>

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


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.

Parameter Type Description
to Position The Position to move to.

Promise<void>

import { moveWindow, Position } from '@tauri-apps/plugin-positioner'
await moveWindow(Position.TopRight)

2.0.0


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.

Parameter Type Description
to Position The (tray) Position to move to.

Promise<void>

import { moveWindowConstrained, Position } from '@tauri-apps/plugin-positioner'
await moveWindowConstrained(Position.TrayCenter)

2.1.0


© 2026 Tauri Contributors. CC-BY / MIT