<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "tvOS: 14.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:5UIKit35UICollectionLayoutListConfigurationV"
  },
  "title" : "UICollectionLayoutListConfiguration"
}
-->

# UICollectionLayoutListConfiguration

A configuration for creating a list layout.

```
struct UICollectionLayoutListConfiguration
```

## Overview

Use this configuration to create a list section for a compositional layout ([`UICollectionViewCompositionalLayout`](/documentation/UIKit/UICollectionViewCompositionalLayout)), or a layout containing only list sections. The following example shows how to create a compositional layout that contains only list sections by applying the same configuration to each section in the list layout:

```swift
let configuration = UICollectionLayoutListConfiguration(appearance: .sidebar)
let layout = UICollectionViewCompositionalLayout.list(using: configuration)
```

To implement different list configurations for different sections, use a compositional layout’s section provider to create each section with its own list configuration.

```swift
let layout = UICollectionViewCompositionalLayout() { sectionIndex, layoutEnvironment in
    
    var configuration = UICollectionLayoutListConfiguration(appearance: .insetGrouped)
    configuration.headerMode = sectionIndex == 0 ? .supplementary : .none
    
    let section = NSCollectionLayoutSection.list(using: configuration,
                                                 layoutEnvironment: layoutEnvironment)
    
    return section
}
```

## Topics

### Creating a list layout configuration

[`init(appearance: UICollectionLayoutListConfiguration.Appearance)`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/init(appearance:))

Creates a list layout configuration with the specified appearance.

### Configuring appearance

[`var appearance: UICollectionLayoutListConfiguration.Appearance`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/appearance-swift.property)

The overall appearance of the list.

[`var backgroundColor: UIColor?`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/backgroundColor)

The background color of the list.

[`enum Appearance`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/Appearance-swift.enum)

Constants that describe the appearance of the list.

### Configuring separators

[`var showsSeparators: Bool`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/showsSeparators)

A Boolean value that determines whether the list shows separators between cells.

[`var separatorConfiguration: UIListSeparatorConfiguration`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/separatorConfiguration)

The section’s preferred configuration for list separators.

[`struct UIListSeparatorConfiguration`](/documentation/UIKit/UIListSeparatorConfiguration-swift.struct)

A configuration that controls the list separator appearance in a list section.

[`var itemSeparatorHandler: UICollectionLayoutListConfiguration.ItemSeparatorHandler?`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/itemSeparatorHandler-swift.property)

The closure that provides granular control over the list separator appearance of each item.

[`typealias ItemSeparatorHandler`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/ItemSeparatorHandler-swift.typealias)

A closure that provides granular control over list separator appearance.

### Configuring headers and footers

[`var headerMode: UICollectionLayoutListConfiguration.HeaderMode`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/headerMode-swift.property)

The type of header to use for the list.

[`var footerMode: UICollectionLayoutListConfiguration.FooterMode`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/footerMode-swift.property)

The type of footer to use for the list.

[`enum HeaderMode`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/HeaderMode-swift.enum)

Constants that describe the list’s header mode.

[`enum FooterMode`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/FooterMode-swift.enum)

Constants that describe the list’s footer mode.

[`var headerTopPadding: CGFloat?`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/headerTopPadding)

The amount of padding above each section header.

### Customizing swipe actions

[`var leadingSwipeActionsConfigurationProvider: UICollectionLayoutListConfiguration.SwipeActionsConfigurationProvider?`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/leadingSwipeActionsConfigurationProvider)

The closure that provides the set of actions to display when swiping on the leading edge of the cell.

[`var trailingSwipeActionsConfigurationProvider: UICollectionLayoutListConfiguration.SwipeActionsConfigurationProvider?`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/trailingSwipeActionsConfigurationProvider)

The closure that provides the set of actions to display when swiping on the trailing edge of the cell.

[`typealias SwipeActionsConfigurationProvider`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/SwipeActionsConfigurationProvider)

A closure that configures the swipe actions for a cell.

### Managing content-hugging behavior

[`var contentHuggingElements: UICollectionLayoutListConfiguration.ContentHuggingElements`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/contentHuggingElements-swift.property)

A setting that determines which type of items tightly hug their content.

[`struct ContentHuggingElements`](/documentation/UIKit/UICollectionLayoutListConfiguration-swift.struct/ContentHuggingElements-swift.struct)

Constants that determine which types of items in a collection view tightly hug their content.

## See Also

[`static func list(using: UICollectionLayoutListConfiguration, layoutEnvironment: any NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection`](/documentation/UIKit/NSCollectionLayoutSection/list(using:layoutEnvironment:))

Creates a list section with the specified list configuration and layout environment.



---

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)