<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIStackView/axis",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIStackView(py)axis"
  },
  "title" : "axis"
}
-->

# axis

The axis along which the arranged views lay out.

```
var axis: NSLayoutConstraint.Axis { get set }
```

## Discussion

This property determines the orientation of the arranged views. Assigning the [`NSLayoutConstraint.Axis.vertical`](/documentation/UIKit/NSLayoutConstraint/Axis/vertical) value creates a column of views. Assigning the [`NSLayoutConstraint.Axis.horizontal`](/documentation/UIKit/NSLayoutConstraint/Axis/horizontal) value creates a row. The default value is [`NSLayoutConstraint.Axis.horizontal`](/documentation/UIKit/NSLayoutConstraint/Axis/horizontal).

---

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)