Tauri Core API - v2.6.0
    Preparing search index...

    Interface WindowOptions

    Configuration for the window to create.

    1.0.0

    interface WindowOptions {
        center?: boolean;
        x?: number;
        y?: number;
        width?: number;
        height?: number;
        minWidth?: number;
        minHeight?: number;
        maxWidth?: number;
        maxHeight?: number;
        preventOverflow?: boolean | PreventOverflowMargin;
        resizable?: boolean;
        title?: string;
        fullscreen?: boolean;
        focus?: boolean;
        transparent?: boolean;
        maximized?: boolean;
        visible?: boolean;
        decorations?: boolean;
        alwaysOnTop?: boolean;
        alwaysOnBottom?: boolean;
        contentProtected?: boolean;
        skipTaskbar?: boolean;
        shadow?: boolean;
        theme?: Theme;
        titleBarStyle?: TitleBarStyle;
        trafficLightPosition?: dpi.LogicalPosition;
        hiddenTitle?: boolean;
        tabbingIdentifier?: string;
        maximizable?: boolean;
        minimizable?: boolean;
        closable?: boolean;
        parent?: string | Window | WebviewWindow;
        visibleOnAllWorkspaces?: boolean;
        windowEffects?: Effects;
        backgroundColor?: webview.Color;
        backgroundThrottling?: BackgroundThrottlingPolicy;
        javascriptDisabled?: boolean;
        allowLinkPreview?: boolean;
        disableInputAccessoryView?: boolean;
    }
    Index

    Properties

    center?: boolean

    Show window in the center of the screen..

    x?: number

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

    y?: number

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

    width?: number

    The initial width.

    height?: number

    The initial height.

    minWidth?: number

    The minimum width. Only applies if minHeight is also set.

    minHeight?: number

    The minimum height. Only applies if minWidth is also set.

    maxWidth?: number

    The maximum width. Only applies if maxHeight is also set.

    maxHeight?: number

    The maximum height. Only applies if maxWidth is also set.

    preventOverflow?: boolean | PreventOverflowMargin

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

    Whether the window is resizable or not.

    title?: string

    Window title.

    fullscreen?: boolean

    Whether the window is in fullscreen mode or not.

    focus?: boolean

    Whether the window will be initially focused or not.

    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 > app > macOSPrivateApi. WARNING: Using private APIs on macOS prevents your application from being accepted to the App Store.

    maximized?: boolean

    Whether the window should be maximized upon creation or not.

    visible?: boolean

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

    decorations?: boolean

    Whether the window should have borders and bars or not.

    alwaysOnTop?: boolean

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

    alwaysOnBottom?: boolean

    Whether the window should always be below other windows.

    contentProtected?: boolean

    Prevents the window contents from being captured by other apps.

    skipTaskbar?: boolean

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

    shadow?: boolean

    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.

    2.0.0

    theme?: Theme

    The initial window theme. Defaults to the system theme.

    Only implemented on Windows and macOS 10.14+.

    titleBarStyle?: TitleBarStyle

    The style of the macOS title bar.

    trafficLightPosition?: dpi.LogicalPosition

    The position of the window controls on macOS.

    Requires titleBarStyle: 'overlay' and decorations: true.

    2.4.0

    hiddenTitle?: boolean

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

    tabbingIdentifier?: string

    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.

    maximizable?: boolean

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

    minimizable?: boolean

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

    closable?: boolean

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

    parent?: string | Window | WebviewWindow

    Sets a parent to the window to be created. Can be either a Window or a label of the window.

    visibleOnAllWorkspaces?: boolean

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

    • Windows / iOS / Android: Unsupported.

    2.0.0

    windowEffects?: Effects

    Window effects.

    Requires the window to be transparent.

    backgroundColor?: webview.Color

    Set the window background color.

    • Android / iOS: Unsupported.
    • Windows: alpha channel is ignored.

    2.1.0

    backgroundThrottling?: BackgroundThrottlingPolicy

    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

    2.3.0

    javascriptDisabled?: boolean

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

    allowLinkPreview?: boolean

    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

    disableInputAccessoryView?: boolean

    Allows disabling the input accessory view on iOS.

    The accessory view is the view that appears above the keyboard when a text input element is focused. It usually displays a view with "Done", "Next" buttons.