Skip to content

WindowOptions

Module @netwiv/api/window · Kind Interface

import { WindowOptions } from '@netwiv/api/window';
allowLinkPreview?: boolean | undefined

on macOS and iOS there is a link preview on long pressing links, this is enabled by default. see https://docs.rs/objc2-web-kit/latest/objc2_web_kit/struct.WKWebView.html#method.allowsLinkPreview

alwaysOnBottom?: boolean | undefined

Whether the window should always be below other windows.

alwaysOnTop?: boolean | undefined

Whether the window should always be on top of other windows or not.

backgroundColor?: Color | undefined

Set the window background color.

  • Android / iOS: Unsupported.
  • Windows: alpha channel is ignored.
backgroundThrottling?: BackgroundThrottlingPolicy | undefined

Change the default background throttling behaviour.

  • Linux / Windows / Android: Unsupported. Workarounds like a pending WebLock transaction might suffice.
  • iOS: Supported since version 17.0+.
  • macOS: Supported since version 14.0+.

see https://github.com/tauri-apps/tauri/issues/5250#issuecomment-2569380578

center?: boolean | undefined

Show window in the center of the screen..

closable?: boolean | undefined

Whether the window’s native close button is enabled or not. Defaults to true.

contentProtected?: boolean | undefined

Prevents the window contents from being captured by other apps.

decorations?: boolean | undefined

Whether the window should have borders and bars or not.

focus?: boolean | undefined

Whether the window will be initially focused or not.

focusable?: boolean | undefined

Whether the window can be focused or not.

fullscreen?: boolean | undefined

Whether the window is in fullscreen mode or not.

height?: number | undefined

The initial height in logical pixels.

hiddenTitle?: boolean | undefined

If true, sets the window title to be hidden on macOS.

javascriptDisabled?: boolean | undefined

Whether we should disable JavaScript code execution on the webview or not.

maxHeight?: number | undefined

The maximum height in logical pixels. Only applies if maxWidth is also set.

maximizable?: boolean | undefined

Whether the window’s native maximize button is enabled or not. Defaults to true.

maximized?: boolean | undefined

Whether the window should be maximized upon creation or not.

maxWidth?: number | undefined

The maximum width in logical pixels. Only applies if maxHeight is also set.

minHeight?: number | undefined

The minimum height in logical pixels. Only applies if minWidth is also set.

minimizable?: boolean | undefined

Whether the window’s native minimize button is enabled or not. Defaults to true.

minWidth?: number | undefined

The minimum width in logical pixels. Only applies if minHeight is also set.

parent?: string | Window | WebviewWindow | undefined
preventOverflow?: boolean | PreventOverflowMargin | undefined

Prevent the window from overflowing the working area (e.g. monitor size - taskbar size) on creation, which means the window size will be limited to monitor size - taskbar size

Can either be set to true or to a {@link PreventOverflowMargin} object to set an additional margin that should be considered to determine the working area (in this case the window size will be limited to monitor size - taskbar size - margin)

NOTE: The overflow check is only performed on window creation, resizes can still overflow

  • iOS / Android: Unsupported.
resizable?: boolean | undefined

Whether the window is resizable or not.

scrollBarStyle?: ScrollBarStyle | undefined

Specifies the native scrollbar style to use with the webview. CSS styles that modify the scrollbar are applied on top of the native appearance configured here.

Defaults to default, which is the browser default.

  • Windows:
    • fluentOverlay requires WebView2 Runtime version 125.0.2535.41 or higher, and does nothing on older versions.
    • This option must be given the same value for all webviews.
  • Linux / Android / iOS / macOS: Unsupported. Only supports Default and performs no operation.
shadow?: boolean | undefined

Whether or not the window has shadow.

  • Windows:
  • false has no effect on decorated window, shadows are always ON.
  • true will make undecorated window have a 1px white border, and on Windows 11, it will have a rounded corners.
  • Linux: Unsupported.
skipTaskbar?: boolean | undefined

Whether or not the window icon should be added to the taskbar.

tabbingIdentifier?: string | undefined

Defines the window tabbing identifier on macOS.

Windows with the same tabbing identifier will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled.

theme?: Theme | undefined

The initial window theme. Defaults to the system theme.

Only implemented on Windows and macOS 10.14+.

title?: string | undefined

Window title.

titleBarStyle?: TitleBarStyle | undefined

The style of the macOS title bar.

trafficLightPosition?: LogicalPosition | undefined

The position of the window controls on macOS.

Requires titleBarStyle: 'overlay' and decorations: true.

transparent?: boolean | undefined

Whether the window is transparent or not. Note that on macOS this requires the macos-private-api feature flag, enabled under tauri.conf.json > app > macOSPrivateApi. WARNING: Using private APIs on macOS prevents your application from being accepted to the App Store.

visible?: boolean | undefined

Whether the window should be immediately visible upon creation or not.

visibleOnAllWorkspaces?: boolean | undefined

Whether the window should be visible on all workspaces or virtual desktops.

  • Windows / iOS / Android: Unsupported.
width?: number | undefined

The initial width in logical pixels.

windowEffects?: Effects | undefined

Window effects.

Requires the window to be transparent.

x?: number | undefined

The initial vertical position in logical pixels. Only applies if y is also set.

y?: number | undefined

The initial horizontal position in logical pixels. Only applies if x is also set.


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