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

# button

The button displayed in the status bar.

```
var button: NSStatusBarButton? { get }
```

## Discussion

The status item automatically creates this button by default. Use this property to customize the appearance and behavior of the button, such as its [`image`](/documentation/AppKit/NSButton/image), [`target`](/documentation/AppKit/NSControl/target), [`action`](/documentation/AppKit/NSControl/action), [`toolTip`](/documentation/AppKit/NSView/toolTip), and so on.

---

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)