Build a menu bar app for macOS: the parts you need
The macOS menu bar has two halves that work very differently. The leading side holds the Apple menu and the menus of whichever app is in front. The trailing side holds status items, which Apple's design guidelines call menu bar extras: small icons that stay visible while their app runs in the background. A menu bar app is an app whose main interface is one of those extras. Building one takes five parts: the item itself (SwiftUI's MenuBarExtra or AppKit's NSStatusItem), a setting that keeps the app out of the Dock, a way to start at login, a signed and notarized build, and a plan for the moment the system hides the icon for lack of space. The sections below cover each part with the API names Apple documents today.
What sits in the macOS menu bar
Apple's user guide page on what is in the menu bar, checked on October 18, 2026, names five areas:
| Area | Position | Who controls it |
|---|---|---|
| Apple menu | Far left | The system. Apps cannot change it |
| App menus | Next to the Apple menu | The app in front, starting with its name in bold |
| Status menus | Toward the right | Each app or system feature that adds one |
| Control Center | Right side | The system, with controls users can pin to the bar |
| Notification Center | Click the date and time | The system |
Only the status area is open to third-party apps that are not in front. Everything a menu bar app does has to fit inside an icon in that area and whatever opens when it is clicked.
The Human Interface Guidelines page on the menu bar adds two facts that shape design decisions. The menu bar is 24 points tall, so the icon has to read clearly at that height. And when space is short, the system gives priority to the front app's menus and essential extras, and hides other extras to make room. A menu bar app has no guaranteed place on screen. That one fact drives several of the choices below.
Users also have direct control over extras. They can hold Command and drag an icon to reorder it, and on macOS Tahoe 26 and later, System Settings has a Menu Bar pane with an Allow in the Menu Bar list where each app's item can be switched off, according to Apple's Menu Bar settings page. Plan for an app whose icon may be turned off by the person using it.
SwiftUI MenuBarExtra or AppKit NSStatusItem
There are two ways to put an item in the status area.
MenuBarExtra is a SwiftUI scene, available from macOS 13. Apple describes it as a scene that renders itself as a persistent control in the system menu bar. It takes a title and an image, often an SF Symbol, plus the content to show. Its style decides how that content appears. The .menu style pulls down a standard menu from the icon. The .window style shows the content in a popover-like window, which suits small dashboards, toggles and text fields. Declaring the scene in the App body is enough to get an icon on screen.
NSStatusItem is the AppKit object behind every status item, created through NSStatusBar. It gives lower-level control: a button to set the image or title, a menu property for a pull-down menu, length with variableLength or squareLength, an autosaveName for saving and restoring the item's details, and a behavior property. The behavior options include removalAllowed, which lets people drag the item off the bar with Command held, and terminationOnRemoval, which quits the app when that happens.
How to choose:
- Pick MenuBarExtra when the interface is a menu or a small panel and the rest of the app is SwiftUI. It is less code and follows system styling automatically.
- Pick NSStatusItem when you need to react to left and right clicks differently, swap the icon image often, draw a custom width such as a live number, or support versions older than macOS 13.
- Mixing is common. A SwiftUI app can create an NSStatusItem from its app delegate when MenuBarExtra does not expose a needed property.
MenuBarExtra also has initializers that take an isInserted binding. According to the documentation, the item is shown while the binding is true, and if the user removes the item from the menu bar, the binding is set to false. Store that binding with @AppStorage and the choice survives relaunches. Connect it to a "Show in menu bar" toggle in the settings window and the app has a built-in way back for anyone who removed the icon by accident. This one detail covers most of the support questions a menu bar app receives, which tend to start with "the icon is gone".
The label also matters for accessibility. When the initializer takes both a title and an image, the title is what VoiceOver reads, even though only the image is drawn. Use a short, specific name rather than a generic word such as "Menu".
Whichever route you take, draw the icon as a template image or an SF Symbol. The guidelines note that black and clear define the shape, and the system recolours it for light and dark menu bars and for the selected state. A full-colour icon looks wrong in one of those states.
Keep it out of the Dock and start it at login
Most menu bar apps should not show a Dock icon or an app menu when they run. That is controlled by the Info.plist key LSUIElement, which Apple defines as a Boolean indicating that the app is an agent app that runs in the background and does not appear in the Dock. Set it to YES and the app launches with only its status item visible.
Two side effects need handling. First, an agent app has no app menu, so there is no automatic place for Settings, About or Quit. Put those items in the status item's menu, and make Quit easy to find, because otherwise the only way out is Activity Monitor. Second, windows opened by an agent app do not always come to the front on their own. When the user chooses Settings from the menu, activate the app explicitly before showing the window.
Starting at login is handled by SMAppService in the ServiceManagement framework, available from macOS 13. For a menu bar app, SMAppService.mainApp represents the app itself as a login item. Calling register() adds it and unregister() removes it. The status property reports whether registration needs the user's approval, and openSystemSettingsLoginItems() opens the right page in System Settings so the user can approve it. Expose this as a visible "Open at login" toggle in your settings rather than registering silently on first launch. Users increasingly review the Login Items & Extensions list, and an app that added itself without asking is the first one they remove.
Plan for the icon being hidden
This is the part most tutorials skip. Apple's documentation for NSStatusItem's isVisible property states that the property still returns true even if the item is temporarily hidden because the menu bar has run out of space. Your app cannot reliably tell that its icon is off screen.
On a MacBook with a camera notch, the usable width for status items is smaller still, and a busy app in front can push several extras out at once. The design guidelines also say the system hides and shows extras regularly and that you cannot predict where yours will sit. Build with that in mind:
- Give every important action a keyboard shortcut that works without clicking the icon. A global shortcut that opens the menu or panel is the most direct fallback.
- Keep the icon narrow. A status item that shows text or a live number takes several times the width of a symbol, and wide items are the first to crowd others out.
- Offer a second entry point. The guidelines suggest a Dock menu, available when people Control-click the app's Dock icon, for apps that keep a Dock presence. For agent apps, opening the app again from Finder or Spotlight should bring up its settings window.
- Respect removal. If you set
removalAllowed, people can drag the icon away. Store that choice and provide a setting to bring it back.
Ship it: signing, notarization and permissions
A menu bar app distributed outside the Mac App Store needs a Developer ID signature and notarization. Apple's page on notarizing macOS software before distribution explains that the notary service is an automated scan for malicious content and code signing problems, not App Review. When the software passes, the service issues a ticket that can be stapled to the app and is also published online, so Gatekeeper can find it on first launch. Without it, users see a warning and many will not open the app.
Two practical notes on distribution:
- Staple the ticket to the app or disk image before uploading it, so the first launch does not depend on an online check.
- If the app updates itself, every new build has to be signed and notarized too. Automate this in the release script rather than doing it by hand.
Permissions deserve the same care. Many menu bar utilities need Accessibility access to read or act on other apps' interface elements, and some need Screen Recording access to read what is drawn on screen. macOS asks the user to approve each in System Settings under Privacy & Security. Explain in plain words, before the prompt appears, what the permission is used for and what is never collected. An unexplained request for Screen Recording from a small utility looks suspicious, and users are right to be cautious. A short list of questions and answers, like the permission entries in this FAQ, is a workable model: what each permission reads, what is stored, and what is sent over the network.
Test it in a crowded menu bar
A menu bar app tested on an empty bar will look fine and still fail in real use. Before release, recreate the conditions it will meet:
- Fill the bar with fifteen or twenty other extras and open an app with many menus, such as a code editor or an office suite, on a notched MacBook.
- Switch between light and dark appearance and between a light and dark desktop picture, since the menu bar background can follow the wallpaper.
- Connect and disconnect an external display while the app runs, and check that the menu or panel opens on the screen where the click happened.
- Turn the item off in Allow in the Menu Bar on macOS Tahoe 26 or later, then confirm the app still offers a way back in.
- Log out and in with the login item on, then remove it from Login Items & Extensions and confirm the app's own toggle reflects that.
Each of these exposes a different class of bug, and none appears in a simulator-style test.
What to build first
Start with a MenuBarExtra in the .menu style, LSUIElement set to YES, and a global shortcut that opens the menu, then add SMAppService and notarization before anyone else installs it. For a reference on how an existing organizer handles hidden extras, permissions and per-display layouts, see the Koffret feature list.
Frequently asked questions
What is the difference between a menu bar extra and a status item?
They are the same thing seen from two sides. Menu bar extra is the term in Apple's design guidelines, and NSStatusItem is the AppKit class that implements it. SwiftUI's MenuBarExtra scene creates one for you.
Which macOS version does MenuBarExtra require?
MenuBarExtra and its styles are available from macOS 13. If the app must run on older versions, use NSStatusItem from AppKit, which has been available for much longer.
How do you hide the Dock icon of a menu bar app?
Set the LSUIElement key to YES in the app's Info.plist. The app then runs as an agent app without a Dock icon or app menu, so put Settings and Quit inside the status item's menu.
Why does a menu bar icon not appear even though the app is running?
The most common reason is lack of space: the system hides extras when the front app needs room, and isVisible still reports true. On macOS Tahoe 26 and later, also check whether the item was switched off under Allow in the Menu Bar in System Settings.
Is notarization needed when the app goes to only a few people?
If you distribute the app outside the Mac App Store, notarizing it avoids the Gatekeeper warning on first launch. Even for a small audience, a notarized build saves each recipient from overriding security settings.