How Window Controls Overlay Gives Desktop PWAs More App Space

| 5 min read

The interesting question in desktop PWA design is how much of the window belongs to the app. A title bar reserves a strip for the operating system; Window Controls Overlay lets web content use that strip too, while keeping the window buttons available. That sounds like a small change. It can alter the whole feel of an app.

Web layouts have long relied on rectangles, but newer screens keep testing that assumption. Round displays invite circular clipping. Phone notches and virtual keyboards demand layouts that leave room for hardware and software UI. Foldable and dual-screen devices add another variable: how content should adapt across different device postures.

Sketches of a round display, a common rectangular mobile display, and a device with a foldable display.

These changes make product design harder, but they also create room to rethink familiar layouts. Window Controls Overlay brings that same question to Progressive Web Apps (PWAs), which increasingly sit between websites and native software.

PWAs retain traits people expect from websites: they’re linkable, searchable, responsive, and stable. They can also work offline, read files, and use other capabilities associated with native apps. That combination makes them an unusually interesting design surface. On desktop, though, decades of interface conventions still exert a pull; the history of the graphical interface stretches back more than 40 years.

The familiar desktop PWA still sits inside a rectangle with a title bar across the top. That’s a real design constraint, even if we’ve learned to overlook it.

Here’s the typical arrangement:

Sketches of two rectangular user interfaces representing the desktop Progressive Web App status quo on the macOS and Windows operating systems, respectively. 

A PWA can set the title bar’s color through the Web Application Manifest’s theme_color property. Beyond that, the bar remains a separate band above the app.

What if the app could use that space for its own interface? The result could feel more cohesive with the operating system and give designers more room to work. That’s the promise of Window Controls Overlay: it lets a PWA extend content into the area normally occupied by the title bar, with the window controls layered over the app.

What the title bar and window controls do

The title bar is the top section of an application window, usually where the app’s name appears. Nearby, window controls provide buttons to minimize, maximize, or close that window.

A sketch of a rectangular application user interface highlighting the title bar area and window control buttons.

Window Controls Overlay changes the arrangement: the title bar no longer takes up a separate strip, and the app can use the window’s full height. The title and controls instead sit above the web content.

A sketch of a rectangular application user interface using Window Controls Overlay. The title bar and window controls are no longer in an area separated from the app’s content.

This pattern is already familiar in desktop software. Look at your browser: its tabs occupy space alongside the window controls. Other apps push further. Spotify lets album artwork reach the top edge of its window, and Microsoft Word places features such as search and autosave in the top area.

A screenshot of the top area of a browser’s user interface showing a group of tabs that share the same horizontal space as the app window controls.

Spotify displays album artwork all the way to the top edge of the application window.

A screenshot of an album in Spotify’s desktop application. Album artwork spans the entire width of the main content area, all the way to the top and right edges of the window, and the right edge of the main navigation area on the left side. The application and album navigation controls are overlaid directly on top of the album artwork.

Microsoft Word uses the same top region for autosave, search, and other controls.

A screenshot of Microsoft Word’s toolbar interface. Document file information, search, and other functionality appear at the top of the window, sharing the same horizontal space as the app’s window controls.

The design challenge is to make useful content fit around the window buttons, which vary by platform, and to keep the app usable where the feature isn’t supported. That’s a natural extension of progressive enhancement: improve the experience when the extra space is available, while letting other browsers keep their usual layout.

A small app to try it out

To see how the feature works in practice, we’ll use 1DIV, a compact CSS playground. Users build designs with CSS and a single HTML element. One page shows saved designs:

A screenshot of the 1DIV app displaying a thumbnail grid of CSS designs a user created.

The other page is an editor, with the rendered design above the CSS that produces it:

A screenshot of the 1DIV app editor page. The top half of the window displays a rendered CSS design, and a text editor on the bottom half of the window displays the CSS used to create it.

A web manifest and service worker make 1DIV installable as a desktop PWA. On macOS, both pages have a distinct top bar for the app name and window buttons:

Screenshots of the 1DIV app thumbnail view and CSS editor view on macOS. This version of the app’s window has a separate control bar at the top for the app name and window control buttons.

Windows uses the same basic arrangement:

Screenshots of the 1DIV app thumbnail view and CSS editor view on the Windows operating system. This version of the app’s window also has a separate control bar at the top for the app name and window control buttons.

The empty white strip above the design grid feels like wasted room. In the editor, the case is clearer: letting the artwork reach the window’s top edge would make better use of the canvas. Window Controls Overlay gives us a way to try that.

Turning on Window Controls Overlay

The feature is experimental in this example and must be enabled in a supported browser. It has been implemented in Chromium through work by Microsoft and Google, so the instructions apply to Chrome and Edge: open about://flags and enable Desktop PWA Window Controls Overlay.

Adding the feature to a PWA

The manifest needs a display_override entry that includes window-controls-overlay:

{
"name": "1DIV",
"description": "1DIV is a mini CSS playground",
"lang": "en-US",
"start_url": "/",
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display_override": [
"window-controls-overlay"
],
"icons": [
...
]
}

That manifest change activates the overlay: the separate title bar goes away, and the window buttons move over the page. Getting the layout right still takes CSS and JavaScript, especially if the app should work well across browsers and operating systems.

Here’s the first result on macOS:

Screenshot of the 1DIV app thumbnail view using Window Controls Overlay on macOS. The separate top bar area is gone, but the window controls are now blocking some of the app’s interface

The header now starts at the top of the window, so the logo, search field, and NEW button sit partly behind the window controls. Removing the title bar gained space but also exposed a layout problem.

Windows has the same issue. There, the minimize, maximize, and close buttons sit on the right, beside the PWA controls:

Screenshot of the 1DIV app thumbnail display using Window Controls Overlay on the Windows operating system. The separate top bar area is gone, but the window controls are now blocking some of the app’s content.

Positioning content around the controls

The feature adds four CSS environment variables to describe the available title bar region:

  • titlebar-area-x
  • titlebar-area-y
  • titlebar-area-width
  • titlebar-area-height

Use them with the CSS env() function to place content in that region without running it under the window buttons. For 1DIV, the header holds the logo, search field, and NEW button, so its horizontal position and width need to follow the available title bar area:

header {
position: absolute;
left: env(titlebar-area-x, 0);
width: env(titlebar-area-width, 100%);
height: var(--toolbar-height);
}

titlebar-area-x measures the distance from the viewport’s left edge to the title bar region. titlebar-area-width gives that region’s width; it does not necessarily span the viewport, because the window controls take up part of the top edge.

The second argument to each env() call supplies a fallback. If the variables aren’t available—for example, in a browser without support, or when the overlay is disabled—the header can use its ordinary position and width.

Screenshot of the 1DIV app thumbnail view on macOS with Window Controls Overlay and our CSS updated. The app content that the window controls had been blocking has been repositioned.
Screenshot of the 1DIV app thumbnail view on the Windows operating system with Window Controls Overlay and our updated CSS. The app content that the window controls had been blocking has been repositioned.

Now the header accounts for the controls instead of treating them as an intrusion. The app feels more at home on the desktop, and its content remains visible on both macOS and Windows.

Matching the controls to the page

Next, consider the editor page, where the CSS preview reaches the top of the window:

Screenshots of the 1DIV app CSS editor view with Window Controls Overlay in macOS and Windows, respectively. The window controls overlay areas have a solid white background color, which contrasts with the hot pink color of the example CSS design displayed in the editor.

The content now fills the space, but the white background behind the window controls clashes with the hot-pink design. The layout is doing its job; the color isn’t.

There are two places to set a theme color. A PWA can declare theme_color in its manifest, which the operating system can use to color desktop window chrome. A site can also set a theme-color meta tag for browser interface color; in a PWA, that tag can override the manifest’s theme_color.

For 1DIV, white is a sensible manifest default: the operating system reads it when the app is installed, and it suits the page that lists saved designs. The editor’s preview can have a different background, though. Because JavaScript can update the theme-color meta tag while the app runs, we can change it when a user opens a design.

Here’s the function for doing that:

Designing around the window controls

The theme color can change with the app’s interface, helping the transition between the list and demo views feel less abrupt. CSS transitions can carry that color change, while the window buttons take on the app’s visual style.

function themeWindow(bgColor) {
document.querySelector("meta[name=theme-color]").setAttribute('content', bgColor);
}
Screenshot of the 1DIV app CSS editor view on the Windows operating system with Window Controls Overlay and updated CSS demonstrating how the window control buttons blend in with the rest of the app’s interface.

Give users room to drag

Removing the title bar creates a usability problem that’s easy to miss: users lose the broad, familiar surface they rely on to move a desktop window. With Window Controls Overlay, the remaining space around the buttons can be awkwardly small, forcing people to aim carefully just to drag.

Chromium based browsers provide a CSS fix through the prefixed -webkit-app-region property. Mark an element as a drag target with:

-webkit-app-region: drag;

Interactive controls inside that area need the opposite setting:

-webkit-app-region: no-drag;

One option is to make the header draggable, then exclude its search field and NEW button. But the editor view has no header, so that approach leaves users with nowhere to grab the window while editing. A narrow, separate strip solves both cases:

<div class="drag"></div>
<header>...</header>
.drag {
position: absolute;
top: 0;
width: 100%;
height: env(titlebar-area-height, 0);
-webkit-app-region: drag;
}

The strip spans the viewport and takes its height from titlebar-area-height, putting the draggable area where users expect the old title bar to be. The header’s controls can stay interactive:

header .search,
header .new {
-webkit-app-region: no-drag;
}

That small detail preserves a desktop convention people already understand: the top edge moves the window, while the search field and button still respond to clicks.

An animated view of the 1DIV app being dragged across a Windows desktop with the mouse.

Respond to changes in available space

The controls also take up different amounts of room across platforms, and a window that gets narrow can leave too little space for the logo, search field, and button. A fixed viewport breakpoint can’t tell the app how much room the title bar controls actually occupy.

The Window Controls Overlay API exposes that geometry through navigator.windowControlsOverlay. Its visible property reports whether the overlay is showing, getBoundingClientRect() returns the title bar area’s position and size, and the geometrychange event signals when that geometry or visibility changes.

For example, the app can mark its body as narrow when the available title bar width drops below 250 pixels:

if (navigator.windowControlsOverlay) {
navigator.windowControlsOverlay.addEventListener('geometrychange', () => {
const { width } = navigator.windowControlsOverlay.getBoundingClientRect();
document.body.classList.toggle('narrow', width < 250);
});
}

Checking the API ties this layout response to environments where the feature is available and in use. It also gives the app the actual control area dimensions, which vary between Windows and Mac. The header can then move below the controls, with the thumbnails following its layout:

.narrow header {
top: env(titlebar-area-height, 0);
left: 0;
width: 100%;
}
A screenshot of the 1DIV app on Windows showing the app’s content adjusted for a much narrower viewport.

A small strip with real design value

Window Controls Overlay offers only about 30 extra pixels, and those pixels come with layout and interaction decisions to get right. That’s a modest amount of space. The more meaningful change is that a web app can use it to feel more at home on a desktop.

That idea extends beyond desktop windows. Web features increasingly let authors adapt interfaces to the devices people use, from watches and foldables to PCs. The opportunity is to build those tailored experiences with standard web technology and a shared codebase, while accepting that each new kind of screen or window brings its own design constraints.

The feature is still in early development, so feedback can help shape it. You can open issues on the spec’s repository, read the feature documentation, try the demo app, or inspect its source code.

Source: by · alistapart.com