The pale pill behind the ★ is the highlighted state — click the icon to toggle it
Menu Bar Extra (Status Item)
/ NSStatusItem · MenuBarExtra /
also called status item, menu bar icon, menu bar app, status bar item, tray icon (Windows term)
A menu bar extra is the small icon on the right side of the macOS menu bar, next to the clock — Wi-Fi, battery, and third-party apps all live here. In AppKit it is an NSStatusItem; SwiftUI calls the whole construct a MenuBarExtra. When you click one, its button enters the highlighted state — a pale rounded background that stays visible for as long as its menu or popover is open, then fades when the menu closes.
Anatomy — every part, named
- 1Template icon
NSImage.isTemplate“The monochrome icon that recolors itself” is a template icon.
- 2Highlighted state
NSStatusBarButton.isHighlighted“The thing behind the menu bar icon that gets highlighted” is the status button's highlighted state.
- 3Attached menu or popover
NSStatusItem.menu“The actual menu bar window that opens” is the status item's attached menu or popover.
Prompt — paste into your agent
Add a menu bar extra — an NSStatusItem in the macOS menu bar (SwiftUI: MenuBarExtra). While its menu or popover is open, the status item's button must show its highlighted state: the pale rounded background (NSStatusBarButton.isHighlighted), exactly like system menu bar icons.
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).
| AppKit | NSStatusItem | |
| SwiftUI | MenuBarExtra | macOS 13+ |
| AppKit | NSStatusBar.system.statusItem(withLength:) | how one is created |
| AppKit | NSStatusBarButton.isHighlighted | the pale rounded background while its menu is open |