---
title: zIndex
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nscollectionviewlayoutattributes/zindex
---

# zIndex

The element’s position on the z axis.

## Declaration

```swift
var zIndex: Int { get set }
```

## Discussion

Discussion Use this property to specify the front-to-back ordering of items during layout. Items with higher index values appear on top of those with lower values. Items with the same value have an undetermined order. The default value of this property is 0.

## See Also

### Accessing the Layout Attributes

- [frame](appkit/nscollectionviewlayoutattributes/frame.md)
- [size](appkit/nscollectionviewlayoutattributes/size.md)
- [alpha](appkit/nscollectionviewlayoutattributes/alpha.md)
- [isHidden](appkit/nscollectionviewlayoutattributes/ishidden.md)
