<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSStatusItem",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSStatusItem"
  },
  "title" : "NSStatusItem"
}
-->

# NSStatusItem

An individual element displayed in the system menu bar.

```
class NSStatusItem
```

## Overview

The [`NSStatusBar`](/documentation/AppKit/NSStatusBar) method [`statusItem(withLength:)`](/documentation/AppKit/NSStatusBar/statusItem(withLength:)) creates instances of this class and automatically adds them to the menu bar. Use the [`button`](/documentation/AppKit/NSStatusItem/button) property to customize the appearance and behavior of the status item.

## Topics

### Getting the item’s status bar

[`statusBar`](/documentation/AppKit/NSStatusItem/statusBar)

The status bar that displays the status item.

### Managing the status item’s behavior

[`behavior`](/documentation/AppKit/NSStatusItem/behavior-swift.property)

The set of allowed behaviors for the status item.

[`Behavior`](/documentation/AppKit/NSStatusItem/Behavior-swift.struct)

A set of optional status item behaviors.

[`button`](/documentation/AppKit/NSStatusItem/button)

The button displayed in the status bar.

[`menu`](/documentation/AppKit/NSStatusItem/menu)

The pull-down menu displayed when the user clicks the status item.

### Configuring the status item’s appearance

[`visible`](/documentation/AppKit/NSStatusItem/isVisible)

A Boolean value indicating if the menu bar currently displays the status item.

[`length`](/documentation/AppKit/NSStatusItem/length)

The amount of space in the status bar that should be allocated to the status item.

[`NSSquareStatusItemLength`](/documentation/AppKit/NSStatusItem/squareLength)

A status item length that is equal to the status bar’s thickness.

[`NSVariableStatusItemLength`](/documentation/AppKit/NSStatusItem/variableLength)

A status item length that dynamically adjusts to the width of its contents.

[`view`](/documentation/AppKit/NSStatusItem/view)

The custom view the status item displays at its position in the status bar.

### Configuring target-action behavior

[`target`](/documentation/AppKit/NSStatusItem/target)

The object that receives the status item’s action message when someone clicks the status item.

[`action`](/documentation/AppKit/NSStatusItem/action)

The selector the status item sends to its target when someone clicks the status item.

### Managing the expanded interface

[`expandedInterfaceDelegate`](/documentation/AppKit/NSStatusItem/expandedInterfaceDelegate)

The delegate that manages the lifecycle of the status item’s expanded interface.

[`expandedInterfaceSession`](/documentation/AppKit/NSStatusItem/expandedInterfaceSession)

A session object that tracks the lifecycle of the status item’s active expanded interface.

### Setting the autosave name

[`autosaveName`](/documentation/AppKit/NSStatusItem/autosaveName-swift.property)

A unique name for saving and restoring information about a status item.

[`AutosaveName`](/documentation/AppKit/NSStatusItem/AutosaveName-swift.typealias)

### Deprecated

[`enabled`](/documentation/AppKit/NSStatusItem/isEnabled)

A Boolean that indicates whether the status item is enabled to respond to clicks.

[`doubleAction`](/documentation/AppKit/NSStatusItem/doubleAction)

The selector that is sent to the status item’s target when the status item is double-clicked.

[`-  sendActionOn:`](/documentation/AppKit/NSStatusItem/sendAction(on:))

Sets the conditions on which the status item sends action messages to its target.

[`-  popUpStatusItemMenu:`](/documentation/AppKit/NSStatusItem/popUpMenu(_:))

Displays a menu under a custom status bar item.

[`title`](/documentation/AppKit/NSStatusItem/title)

The string that is displayed at the status item’s position in the status bar.

[`attributedTitle`](/documentation/AppKit/NSStatusItem/attributedTitle)

The attributed string that is displayed at the status item’s position in the status bar.

[`image`](/documentation/AppKit/NSStatusItem/image)

The image that is displayed at the status item’s position in the status bar.

[`alternateImage`](/documentation/AppKit/NSStatusItem/alternateImage)

The alternate image to be displayed when a status bar item is highlighted.

[`highlightMode`](/documentation/AppKit/NSStatusItem/highlightMode)

A Boolean that indicates whether the status item is highlighted when it is clicked.

[`toolTip`](/documentation/AppKit/NSStatusItem/toolTip)

The tool tip string that is displayed when the cursor pauses over the status item.

[`-  drawStatusBarBackgroundInRect:withHighlight:`](/documentation/AppKit/NSStatusItem/drawStatusBarBackground(in:withHighlight:))

Draws the menu background pattern for a custom status-bar item in regular or highlight pattern.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)