position
the Top-left corner position of the monitor relative to the larger full screen area, in physical pixels.
Note that window creation options such as x, y, width and height expect logical pixels, so convert with {@linkcode Monitor.scaleFactor} first:
import { currentMonitor } from '@tauri-apps/api/window';
import { WebviewWindow } from '@tauri-apps/api/webviewWindow';
const monitor = await currentMonitor();
if (monitor) {
const position = monitor.position.toLogical(monitor.scaleFactor);
const webview = new WebviewWindow('my-label', { x: position.x, y: position.y });
}Content copied to clipboard