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

# stateImageWidth

The width of the image used to indicate the state of the menu item.

```
var stateImageWidth: CGFloat { get }
```

## Discussion

If the menu item has multiple images associated with it (to indicate any of the available states: on, off, or mixed), this property contains the width of the largest image. You can set the state images for a menu item using the setOnStateImage:, setOffStateImage:, and setMixedStateImage: methods of [`NSMenuItem`](/documentation/AppKit/NSMenuItem).

To change the state of the cell’s menu item, use the setState: method of [`NSMenuItem`](/documentation/AppKit/NSMenuItem).

---

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)