---
title: NSCollectionLayoutSection
framework: appkit
role: symbol
role_heading: Class
path: appkit/nscollectionlayoutsection
---

# NSCollectionLayoutSection

A container that combines a set of groups into distinct visual groupings.

## Declaration

```swift
@MainActor class NSCollectionLayoutSection
```

## Overview

Overview A collection view layout has one or more sections. Sections provide a way to separate the layout into distinct pieces. Each section can have the same layout or a different layout than the other sections in the collection view. A section’s layout is determined by the properties of the group (NSCollectionLayoutGroup) that’s used to create the section. In the Photos app, each section in the Years page uses the same layout. In the App Store, the Apps page displays several sections with different content arrangements.

Each section can have its own background, header, and footer to distinguish it from other sections.

## Topics

### Creating a section

- [init(group:)](appkit/nscollectionlayoutsection/init(group:).md)

### Specifying scrolling behavior

- [orthogonalScrollingBehavior](appkit/nscollectionlayoutsection/orthogonalscrollingbehavior.md)

### Configuring section spacing

- [interGroupSpacing](appkit/nscollectionlayoutsection/intergroupspacing.md)
- [contentInsets](appkit/nscollectionlayoutsection/contentinsets.md)

### Configuring additional views

- [boundarySupplementaryItems](appkit/nscollectionlayoutsection/boundarysupplementaryitems.md)
- [decorationItems](appkit/nscollectionlayoutsection/decorationitems.md)

### Rendering items

- [visibleItemsInvalidationHandler](appkit/nscollectionlayoutsection/visibleitemsinvalidationhandler.md)

### Deprecated

- [supplementariesFollowContentInsets](appkit/nscollectionlayoutsection/supplementariesfollowcontentinsets.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)

## See Also

### Components

- [NSCollectionLayoutItem](appkit/nscollectionlayoutitem.md)
- [NSCollectionLayoutGroup](appkit/nscollectionlayoutgroup.md)
