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

# indexPath

The index path of the element.

```
var indexPath: IndexPath? { get set }
```

## Discussion

Use the index path to locate information about the item in your app’s data structures. For supplementary and decoration views, you must also use the [`representedElementKind`](/documentation/AppKit/NSCollectionViewLayoutAttributes/representedElementKind) property to identify the element.

---

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)