---
title: button
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsstatusitem/button
---

# button

The button displayed in the status bar.

## Declaration

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

## Discussion

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, target, action, toolTip, and so on.

## See Also

### Managing the Status Item’s Behavior

- [behavior](appkit/nsstatusitem/behavior-swift.property.md)
- [NSStatusItem.Behavior](appkit/nsstatusitem/behavior-swift.struct.md)
- [menu](appkit/nsstatusitem/menu.md)
