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

# sectionCollapseButton

A control that lets users collapse and open a collection view section.

```
@MainActor @IBOutlet weak optional var sectionCollapseButton: NSButton? { get set }
```

## Discussion

For the best user experience, set this property to the button that lets users control the collapsing of a section so that the collection view can show and hide the button appropriately, based on whether the section’s items can be displayed in the available space. The collection view uses its [`toggleSectionCollapse(_:)`](/documentation/AppKit/NSCollectionView/toggleSectionCollapse(_:)) property to access this button.

---

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)