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

# alternateImage

An alternate image that appears on the button when the button is in an on state.

```
var alternateImage: NSImage? { get set }
```

## Discussion

The value of this property is `nil` if there is no alternate image for the button. Note that some button types don’t display an alternate image, and buttons don’t display images by default. If you use this property to set an image, the button redraws its contents if necessary.

## See Also

[`keyEquivalent`](/documentation/AppKit/NSButton/keyEquivalent)

The key-equivalent character of the button.

[`-  setButtonType:`](/documentation/AppKit/NSButton/setButtonType(_:))

Sets the button’s type, which affects its user interface and behavior when clicked.



---

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)