---
title: alternateImage
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsbutton/alternateimage
---

# alternateImage

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

## Declaration

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

## Discussion

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

### Related Documentation

- [keyEquivalent](appkit/nsbutton/keyequivalent.md)
- [setButtonType(_:)](appkit/nsbutton/setbuttontype(_:).md)

### Configuring button images

- [image](appkit/nsbutton/image.md)
- [imagePosition](appkit/nsbutton/imageposition.md)
- [NSControl.ImagePosition](appkit/nscontrol/imageposition.md)
- [isBordered](appkit/nsbutton/isbordered.md)
- [isTransparent](appkit/nsbutton/istransparent.md)
- [bezelStyle](appkit/nsbutton/bezelstyle-swift.property.md)
- [bezelColor](appkit/nsbutton/bezelcolor.md)
- [showsBorderOnlyWhileMouseInside](appkit/nsbutton/showsborderonlywhilemouseinside.md)
- [imageHugsTitle](appkit/nsbutton/imagehugstitle.md)
- [imageScaling](appkit/nsbutton/imagescaling.md)
