name thatuiuser interface
Finder
Mon 9:41

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

  1. 1
    Template iconNSImage.isTemplate

    “The monochrome icon that recolors itself” is a template icon.

  2. 2
    Highlighted stateNSStatusBarButton.isHighlighted

    “The thing behind the menu bar icon that gets highlighted” is the status button's highlighted state.

  3. 3
    Attached menu or popoverNSStatusItem.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).

AppKitNSStatusItem
SwiftUIMenuBarExtramacOS 13+
AppKitNSStatusBar.system.statusItem(withLength:)how one is created
AppKitNSStatusBarButton.isHighlightedthe pale rounded background while its menu is open

See also

Search

Describe the UI element you're thinking of