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.

7/7 checksv1.0.1Updated Oct 11, 2026Ships with a test
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.

Update without losing your edits

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)

Quality scorecard

7/7

Every applicable check passes

Measured in Chromium 153.0.8010.12 on October 19, 2026, on version 1.0.1, across 2 examples.

How we measure
  • Passed: Accessibility scan

    No serious or critical issues in light and dark, on a phone and a desktop (axe-core 4.13.0, WCAG 2.1 AA and best-practice rules).

  • Passed: Small screens

    No sideways scrolling at 360, 390 or 1280 px wide.

  • Passed: Reduced motion

    No endless animation to begin with.

  • Passed: Right to left

    Mirrors correctly in Arabic, Hebrew, Persian and Urdu layouts (9% of elements off the mirror, limit 15%).

  • Passed: Clean console

    No console errors or React hydration errors while loading.

  • Passed: Keyboard

    26 tab stops, each showing a visible change when it takes focus. 3 documented keys.

  • Not applicable: Loading, empty and error

    Does not show data or take submissions.

  • Passed: Automated tests

    Covered by app-window.test.tsx.

  • For information: Footprint

    4.1 KB of source (gzip) in 1 file. No extra npm packages.

Automated checks find a subset of problems and do not replace testing with a screen reader and a keyboard in your own app. What they miss.

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

Ballmac UI Pro

Need the whole screen, not one piece?

311 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.