Window Configuration

Learn how to configure application windows in Tauri v2 using the app configuration, covering creation, size, position, behavior, and visual appearance settings.

The windows array inside the app configuration section is where you define every window your Tauri application can open. Each entry is an object with a unique label and a set of properties that control how that window looks and behaves when the app starts. You can declare multiple windows here, and each will be created automatically at launch. Windows that need to appear later—like settings panels or secondary views—can also be spawned at runtime, but the configuration is always the starting point for the ones your app ships with.

Every window object requires at least a label and a title. The label is an internal identifier used by Tauri to refer to a specific window across your frontend and Rust code. The title is the human-readable text shown in the window’s title bar. If you do not specify a url, the window loads your application’s default entry point, which is the index.html inside frontendDist.

Configuration file location:

All window definitions live inside src-tauri/tauri.conf.json. If you are using TOML or JSON5, the same properties apply under [[app.windows]].

Creating Windows

A minimal window definition tells Tauri to open a single labeled window with a title and default size when the app launches.

src-tauri/tauri.conf.json
{
  "app": {
    "windows": [
      {
        "label": "main",
        "title": "My Application",
        "width": 800,
        "height": 600
      }
    ]
  }
}

The label must be unique across all windows—both those defined in the configuration and any created at runtime. Duplicate labels cause Tauri to exit with an error, because the runtime uses labels to track each window instance.

Duplicate labels cause a runtime error:

If two window objects share the same label, Tauri will panic when it tries to create the second one. Always review your configuration for accidental duplicates, especially when combining static entries with programmatic window creation.

You are not limited to windows that appear at startup. Setting visible: false lets you define a window in the config but show it later from your frontend or Rust code using WebviewWindow.getByLabel("settings")?.show(). This is useful for secondary windows that need to exist before they are displayed, for example windows that receive events in the background.

Programmatic creation from the frontend is also possible, though it relies on the Tauri runtime being ready. The @tauri-apps/api package exposes a WebviewWindow constructor that mirrors most configuration properties.

src/App.tsx
import { WebviewWindow } from '@tauri-apps/api/webviewWindow';
function openSettings() {
  new WebviewWindow('settings', {
    url: '/settings.html',
    title: 'Settings',
    width: 450,
    height: 350,
    resizable: false,
    center: true,
  });
}

Verify your configuration:

Run cargo tauri dev after editing tauri.conf.json. If your window appears with the correct title and dimensions, the configuration was applied successfully.

Window Size & Position

Size and placement are controlled by width, height, x, y, minWidth, minHeight, maxWidth, maxHeight, and center. If you omit width and height, Tauri uses a default of 800×600 pixels. The x and y coordinates set the window’s top‑left corner relative to the primary monitor’s top‑left origin; if you leave them out, the operating system decides where the window appears.

src-tauri/tauri.conf.json
{
  "app": {
    "windows": [
      {
        "label": "editor",
        "title": "Code Editor",
        "width": 1024,
        "height": 768,
        "minWidth": 640,
        "minHeight": 480,
        "maxWidth": 1920,
        "maxHeight": 1080,
        "center": true
      }
    ]
  }
}

When center is true, the window is automatically centered on the primary monitor. This flag takes precedence over x and y: if both center and explicit coordinates are set, the centered position wins. The constraints minWidth, minHeight, maxWidth, and maxHeight prevent the user—or your code—from resizing the window beyond those limits. Setting a minimum greater than a maximum is logically inconsistent; Tauri will not warn you, but the window’s resize behavior becomes unpredictable, so it is best to keep these values sensible.

Coordinate placement on multi‑monitor setups:

The x and y values are relative to the primary monitor. On a system with multiple monitors, especially when the primary monitor is not the leftmost one, a negative x can place the window on a secondary display. If you need per‑monitor placement logic, you will need to handle window positioning at runtime using the window API.

Window Behavior

Behavioral flags determine what the user can do with the window and how it interacts with the desktop environment. The most commonly used flags are:

PropertyTypeDefaultDescription
resizablebooleantrueWhether the user can resize the window.
fullscreenbooleanfalseStarts the window in fullscreen mode.
decorationsbooleantrueShows the native title bar and window controls.
alwaysOnTopbooleanfalseKeeps the window above all other windows.
skipTaskbarbooleanfalseHides the window from the taskbar / dock.
focusbooleantrueGives keyboard focus to the window when it is created.
visiblebooleantrueControls initial visibility. Set to false for background windows.
closablebooleantrueShows a close button (ignored on some platforms).
minimizablebooleantrueAllows the window to be minimized.
maximizablebooleantrueAllows the window to be maximized.

These properties are independent; you can mix them to produce windows that behave as floating toolbars, borderless overlays, or standard application windows.

src-tauri/tauri.conf.json
{
  "app": {
    "windows": [
      {
        "label": "overlay",
        "title": "Floating Tool",
        "width": 300,
        "height": 200,
        "decorations": false,
        "alwaysOnTop": true,
        "skipTaskbar": true,
        "resizable": false
      }
    ]
  }
}

A window without decorations has no native title bar, close button, or minimize/maximize controls. Users cannot drag it by its frame, so you must implement custom drag regions in your frontend with the data-tauri-drag-region attribute if the window needs to be movable.

Custom drag regions for frameless windows:

When decorations is false, add data-tauri-drag-region to any HTML element you want to act as a drag handle. This is essential for frameless utility windows that should still be repositionable.

Window Appearance

Visual appearance is controlled by title, url, transparent, and windowEffects. The title is what the user sees in the title bar; url overrides the default loaded page so you can point a window to a separate HTML file or an external URL if permitted by your Content Security Policy.

Transparency unlocks non‑rectangular window shapes. When transparent is true, the webview’s background becomes translucent, and any pixel not drawn by your frontend is completely transparent. This allows you to create rounded corners, custom window shapes, and seamless overlays.

Transparency on Windows 7:

Transparent windows are not supported on Windows 7. Attempting to use transparent: true on that platform will cause visual artifacts or a failure to render. If you target Windows 7, leave this property set to false.

windowEffects applies platform‑specific visual effects to the window’s background. On Windows, you can use acrylic, mica, or tabbed; on macOS, vibrancy with various styles (like sidebar, fullscreenUI, or hudWindow) is available.

src-tauri/tauri.conf.json
{
  "app": {
    "windows": [
      {
        "label": "styled",
        "title": "Modern UI",
        "width": 800,
        "height": 600,
        "transparent": true,
        "windowEffects": {
          "effects": ["mica"]
        }
      }
    ]
  }
}

On macOS, using vibrancy requires the macOSPrivateApi setting to be enabled in the app configuration. Without it, the effect is silently ignored.

macOS vibrancy requires private API:

Set "macOSPrivateApi": true at the top level of app to enable vibrancy effects on macOS. This flag also permits transparent backgrounds on that platform. Without it, transparent windows will have a solid black background on macOS.

The shadow property (default true) controls the drop shadow around the window. Setting it to false removes the shadow, which can be desirable for completely seamless overlays or custom‑shaped windows.


Configuring windows is the first step toward shaping how users experience your application. Every window you define becomes a surface for your frontend, and the combination of size, behavior, and appearance gives you precise control over the desktop‑native feel of each one.

Creating Windows

Define and spawn application windows in Tauri v2 using the configuration file, Rust backend, and JavaScript frontend

Window Size & Position

How to set a Tauri window's initial size and position, constrain its resizing, move it programmatically, and restore its state across sessions using the window-state plugin.

Window Behavior Configuration

Configure how Tauri windows behave - resizability, fullscreen, always-on-top, focus, decorations, and all other runtime behavioral properties

Window Appearance

Configure decorations, transparency, shadows, themes, background color, and visibility to control the look and feel of Tauri windows