Ballmac UI home

App Window

The window chrome of a real desktop app (Tauri or Electron): a title bar that drags the window, double-click to maximize, and the controls the platform draws: traffic lights, Windows caption buttons, or none.

v1.0.1Updated Oct 11, 2026Ships with a testUpdate without losing your edits

What changed
  1. 1.0.1 Oct 11, 2026macOS traffic lights are 12 px apart so every target meets the 24 px target-size rule (WCAG 2.5.8).
  2. 1.0.0 Oct 12, 2026First release.
Notes

Launch

Ship the beta on Friday, then write the changelog and invite the first ten teams.

Installation

$ pnpm dlx shadcn@latest add @ballmac/app-window

Usage

import { AppWindow, AppWindowTitleBar, AppWindowControls, AppWindowContent } from "@/components/ballmac/app-window"

The full example is in the Code tab above.

Examples

One window, three feels

Quarterly plan

Hiring, launch dates and the budget review.

macOS
Quarterly plan

Hiring, launch dates and the budget review.

Windows
Quarterly plan

Hiring, launch dates and the budget review.

iOS

API reference

<AppWindow>

PropTypeDefault
feel

Which platform's chrome to draw. Defaults to the page's feel (`data-feel`), which Feel Auto sets from the device.

FeelId—
active

Whether the window is the focused one. Defaults to following the real window focus.

boolean—
maximized

The window fills the screen: corners square off and the Windows button shows "restore".

booleanfalse
onClose

Called by the close button. Without a handler the button is drawn but not focusable.

() => void—
onMinimize

Called by the minimize button.

() => void—
onMaximize

Called by the maximize (Windows) or zoom (macOS) button, and when the title bar is double-clicked.

() => void—
onFullscreen

Called by the macOS green button; hold Option to call onMaximize instead. Falls back to onMaximize.

() => void—

<AppWindowControls>

PropTypeDefault
feelFeelId—

<AppWindowTitleBar>

PropTypeDefault
title

The window title. Centered on macOS and iOS, at the start beside the icon on Windows.

React.ReactNode—
icon

A small icon before the title (Windows).

React.ReactNode—
leading

Items after the controls and title, at the start (a back button, a sidebar toggle).

React.ReactNode—
controls

Draw the window controls. Turn off when something else draws them.

booleantrue

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabReaches the window controls when their handlers are set, then the toolbar
Enter / SpacePresses the focused window control
Double-click the barMaximizes or restores (calls onMaximize)

Use with AI

Real window chrome for a Tauri or Electron app. <AppWindow onClose onMinimize onMaximize><AppWindowTitleBar title="…">toolbar</AppWindowTitleBar><AppWindowContent/></AppWindow>. It draws the platform's controls (macOS traffic lights on the left, Windows caption buttons on the right, none on iOS or web) from the page's feel, drags the window, and maximizes on double-click. You wire the callbacks; there is no Tauri or Electron dependency. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI App Window (@ballmac/app-window) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • The window of a Tauri or Electron app with a hidden native title bar (decorations: false, or titleBarStyle hidden)
  • A desktop-style web app that should match the platform's window chrome

Not for

  • Landing-page mockups of a Mac app (use mac-window)
  • Modal dialogs inside a web app (use dialog)

Registry JSON: https://ui.ballmac.com/r/app-window.json

Credits

Based on tauri-controls, adapted by Ballmac. Free to use in personal and commercial projects.

npm
None