Founding sponsorYour name here
Documents

Delete “Q3 Report”?

A sheet blocks only this window — the rest of the app stays usable.

The panel sliding from the title bar is a sheet — modal to its window only

Sheet

/ NSWindow.beginSheet(_:completionHandler:) · NSWindow.endSheet(_:returnCode:) /

also called window-modal dialog, document-modal dialog, attached sheet

A sheet is a modal panel attached to a particular window, traditionally descending from its title bar. It prevents interaction with that parent window while other app windows can remain usable. An app-modal dialog instead blocks the application as a whole and is not visually attached to one document window.

If you called it…

dialog that slides down from the window title barmodal attached to just one mac windowpanel hanging from the top of the document windowsave dialog attached to its parent windowpopup that blocks one window but not the whole app

…you meant a sheet.

Anatomy — every part, named

  1. 1
    Dimming layerView.sheet(isPresented:content:)

    “The darkened area behind the sheet” is the dimming layer that marks the parent surface as temporarily unavailable.

Prompt — paste into your agent

Present this as a window-modal Sheet with NSWindow.beginSheet(_:completionHandler:) (SwiftUI: View.sheet), visibly attached beneath the parent window's title bar. Block only that parent window, not every window in the app.

Debug prompt — when it misbehaves

Paste this, then describe what you’re seeing — it hands your agent the classic failure modes to rule out first.

Debug my macOS sheet (NSWindow.beginSheet(_:completionHandler:), SwiftUI View.sheet). Rule out: the isPresented/item binding never reset so it will not present a second time; endSheet never called so the parent window stays blocked; presenting from a view controller detached from the window so nothing appears; two sheets queued on one window presenting back-to-back unexpectedly. The symptom:

In code

The exact names this thing goes by in code — each row is one framework’s word for it. Use the row that matches your project (or paste it into your prompt).

AppKitNSWindow.beginSheet(_:completionHandler:)
AppKitNSWindow.endSheet(_:returnCode:)
SwiftUIView.sheet(isPresented:onDismiss:content:)
AppKitNSApplication.runModal(for:)app-modal alternative, not a sheet

See also

Search

Describe the UI element you're thinking of