5.8 KiB
@tauri-apps/api / window / WindowOptions
Interface: WindowOptions
window.WindowOptions
Configuration for the window to create.
Properties
alwaysOnTop
Optional alwaysOnTop: boolean
Whether the window should always be on top of other windows or not.
Defined in
center
Optional center: boolean
Show window in the center of the screen..
Defined in
decorations
Optional decorations: boolean
Whether the window should have borders and bars or not.
Defined in
fileDropEnabled
Optional fileDropEnabled: boolean
Whether the file drop is enabled or not on the webview. By default it is enabled.
Disabling it is required to use drag and drop on the frontend on Windows.
Defined in
focus
Optional focus: boolean
Whether the window will be initially hidden or focused.
Defined in
fullscreen
Optional fullscreen: boolean
Whether the window is in fullscreen mode or not.
Defined in
height
Optional height: number
The initial height.
Defined in
maxHeight
Optional maxHeight: number
The maximum height. Only applies if maxWidth is also set.
Defined in
maxWidth
Optional maxWidth: number
The maximum width. Only applies if maxHeight is also set.
Defined in
maximized
Optional maximized: boolean
Whether the window should be maximized upon creation or not.
Defined in
minHeight
Optional minHeight: number
The minimum height. Only applies if minWidth is also set.
Defined in
minWidth
Optional minWidth: number
The minimum width. Only applies if minHeight is also set.
Defined in
resizable
Optional resizable: boolean
Whether the window is resizable or not.
Defined in
skipTaskbar
Optional skipTaskbar: boolean
Whether or not the window icon should be added to the taskbar.
Defined in
theme
Optional theme: Theme
The initial window theme. Defaults to the system theme.
Only implemented on Windows and macOS 10.14+.
Defined in
title
Optional title: string
Window title.
Defined in
transparent
Optional transparent: boolean
Whether the window is transparent or not.
Note that on macOS this requires the macos-private-api feature flag, enabled under tauri.conf.json > tauri > macOSPrivateApi.
WARNING: Using private APIs on macOS prevents your application from being accepted to the App Store.
Defined in
url
Optional url: string
Remote URL or local file path to open.
- URL such as
https://github.com/tauri-appsis opened directly on a Tauri window. - data: URL such as
data:text/html,<html>...is only supported with thewindow-data-urlCargo feature for thetauridependency. - local file path or route such as
/path/to/page.htmlor/usersis appended to the application URL (the devServer URL on development, ortauri://localhost/andhttps://tauri.localhost/on production).
Defined in
visible
Optional visible: boolean
Whether the window should be immediately visible upon creation or not.
Defined in
width
Optional width: number
The initial width.
Defined in
x
Optional x: number
The initial vertical position. Only applies if y is also set.
Defined in
y
Optional y: number
The initial horizontal position. Only applies if x is also set.