<!-- llms-explorer concept facts · https://llms-explorer.com/tree/nsstatusitem-versus-swiftui-menubarextra-and-activation-policy-lsuielement-and-dock-tile/ · pack 2026-10-02 · ~953 tokens -->

# NSStatusItem versus SwiftUI MenuBarExtra and activation policy LSUIElement and Dock tile

> Source-anchored research for NSStatusItem versus SwiftUI MenuBarExtra and activation policy LSUIElement and Dock tile. Run status: COMPLETED.

Parent: [macOS Menu-Bar App Design](https://llms-explorer.com/tree/macos-menu-bar-app-design/) · 5 facets · 9 facts · page: https://llms-explorer.com/tree/nsstatusitem-versus-swiftui-menubarextra-and-activation-policy-lsuielement-and-dock-tile/

## How it works

- MenuBarExtra has no first-party API to read or set presentation state or to reach the NSStatusItem or popup NSWindow; third-party shims such as MenuBarExtraAccess reverse-engineer the window hierarchy, and direct NSStatusItem edits may be overwritten when SwiftUI refreshes. (medium confidence) — [source](https://github.com/orchetect/MenuBarExtraAccess/discussions/1)
- LSUIElement=YES in Info.plist is only the launch state: it starts the app with the accessory activation policy (no Dock icon, no app menu bar); NSApp.setActivationPolicy can move the process between .accessory and .regular at runtime. (medium confidence) — [source](https://multi.app/blog/nailing-the-activation-behavior-of-a-spotlight-raycast-like-command-palette)

## Measurements and reference values

- A MenuBarExtra whose label/content views create models or new Date() values during body evaluation can loop on macOS 26 and pin the main thread at 100% CPU at launch, even with isInserted false; fix is eager model construction, TimelineView for time, and skipping unchanged writes. (low confidence) (verified as of 2026-01-01) — [source](https://github.com/hartra344/pincer/issues/119)

## Problems, failure modes and limitations

- NSStatusItem (AppKit) supports dynamic width, multiple click targets and non-template colours; the old view property is deprecated since macOS 10.14, so custom content goes through the button property and manual frame sizing. (medium confidence) — [source](https://multi.app/blog/pushing-the-limits-nsstatusitem)
- Accessory-policy apps cannot reliably bring a Settings window to the front or make it key; the workaround is switch to .regular, call NSApp.activate, open settings, then restore .accessory when the window closes. SettingsLink is unreliable inside MenuBarExtra, and the hidden helper window must be declared before the Settings scene. (medium confidence) — [source](https://steipete.me/posts/2025/showing-settings-from-macos-menu-bar-items)
- For a sandboxed live network monitor needing a dynamic status readout, right-click menu or detachable panel, NSStatusItem plus NSPopover/NSMenu is the lower-risk choice; MenuBarExtra fits simple menu or fixed-window UIs. (medium confidence) — [source](https://multi.app/blog/pushing-the-limits-nsstatusitem)

## Comparisons and alternatives

- Using .accessory set in code (instead of LSUIElement) may flash the Dock icon at launch; one reported pattern is .prohibited in applicationWillFinishLaunching then .accessory in applicationDidFinishLaunching. Use LSUIElement=YES for a clean launch. (low confidence) — [source](https://multi.app/blog/nailing-the-activation-behavior-of-a-spotlight-raycast-like-command-palette)

## Facts and statements

- Each SwiftUI MenuBarExtra creates one NSStatusItem under the hood; the status-item button is limited to image, text, or image+text, with no custom view or colour styling through the public API. (high confidence) — [source](https://github.com/orchetect/MenuBarExtraAccess/discussions/1)
- On macOS Tahoe (26) the menu bar grew from 24pt to 30pt and right-clicks at the very top edge no longer fire an NSStatusItem action (left-click still does); reported January 2026 with no Apple reply. (low confidence) (verified as of 2026-01-01) — [source](https://developer.apple.com/forums/thread/811718)
