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

# scrollDirection

The scroll direction of the layout.

```
var scrollDirection: NSCollectionView.ScrollDirection { get set }
```

## Discussion

The flow layout scrolls along one axis only, either horizontally or vertically. When the scroll direction is [`NSCollectionView.ScrollDirection.vertical`](/documentation/AppKit/NSCollectionView/ScrollDirection/vertical), the width of the content never exceeds the width of the collection view itself but the height grows as needed to accommodate the current items. When the scroll direction is [`NSCollectionView.ScrollDirection.horizontal`](/documentation/AppKit/NSCollectionView/ScrollDirection/horizontal), the height never exceeds the height of the collection view but the width grows as needed.

The default value of this property is [`NSCollectionView.ScrollDirection.vertical`](/documentation/AppKit/NSCollectionView/ScrollDirection/vertical).

---

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)