---
title: CPListTemplate
framework: carplay
role: symbol
role_heading: Class
path: carplay/cplisttemplate
---

# CPListTemplate

A template that displays and manages a list of items.

## Declaration

```swift
@MainActor class CPListTemplate
```

## Overview

Overview Use the list template to display a list of items, grouped into one or more sections. When the user selects an item, CarPlay invokes Siri or a custom handler that you provide, depending on the type of list item. If your list displays hierarchical data, use the handler to add templates to the navigation hierarchy. To create a list template, call the init(title:sections:) method and provide an array of CPListSection objects. At runtime, use maximumSectionCount to determine the maximum number of sections your list can display. Use maximumItemCount to determine the maximum number of items across all sections that your list can display. Each section contains an array of list items — objects that conform to either the CPListTemplateItem or the CPSelectableListItem protocol. CarPlay provides three concrete implementations of these protocols: note: The depth of a hierarchical list in CarPlay depends on your app’s entitlements. Food-ordering apps must not exceed two levels. The framework restricts all other categories of apps to five levels. Also, some vehicles limit the number of items that the list displays. See CPSessionConfiguration for more information. To display the list, call your interface controller’s pushTemplate(_:animated:completion:) method, passing in the list template to add it to your navigation hierarchy. Alternatively, add the template as a tab in your CPTabBarTemplate. Integrating Siri Into Your Template App For audio and communication apps, CarPlay provides an assistant cell to let users interact with your app using Siri_._

To enable the assistant cell, your app must support specific Siri intents: To play audio, audio apps must support INPlayMediaIntent. To make phone calls, communication apps must support INStartCallIntent. To enable the assistant cell in your list template, use init(title:sections:assistantCellConfiguration:) and provide the required configuration. For more information, see CPAssistantCellConfiguration. CarPlay automatically updates your app’s interface if you change the template’s assistantCellConfiguration property.

## Topics

### Creating a List Template

- [init(title:sections:)](carplay/cplisttemplate/init(title:sections:).md)
- [init(title:sections:assistantCellConfiguration:)](carplay/cplisttemplate/init(title:sections:assistantcellconfiguration:).md)

### Managing Sections

- [maximumSectionCount](carplay/cplisttemplate/maximumsectioncount.md)
- [sectionCount](carplay/cplisttemplate/sectioncount.md)
- [sections](carplay/cplisttemplate/sections.md)
- [updateSections(_:)](carplay/cplisttemplate/updatesections(_:).md)
- [CPListSection](carplay/cplistsection.md)

### Managing the Assistant Cell

- [assistantCellConfiguration](carplay/cplisttemplate/assistantcellconfiguration.md)
- [CPAssistantCellConfiguration](carplay/cpassistantcellconfiguration.md)

### Managing an Empty List

- [emptyViewTitleVariants](carplay/cplisttemplate/emptyviewtitlevariants.md)
- [emptyViewSubtitleVariants](carplay/cplisttemplate/emptyviewsubtitlevariants.md)

### Getting Supplementary Information

- [maximumItemCount](carplay/cplisttemplate/maximumitemcount.md)
- [itemCount](carplay/cplisttemplate/itemcount.md)
- [indexPath(for:)](carplay/cplisttemplate/indexpath(for:).md)
- [title](carplay/cplisttemplate/title.md)

### Responding to List Events

- [delegate](carplay/cplisttemplate/delegate.md)
- [CPListTemplateDelegate](carplay/cplisttemplatedelegate.md)

### Initializers

- [init(title:listHeader:sections:assistantCellConfiguration:)](carplay/cplisttemplate/init(title:listheader:sections:assistantcellconfiguration:).md)
- [init(title:sections:assistantCellConfiguration:headerGridButtons:)](carplay/cplisttemplate/init(title:sections:assistantcellconfiguration:headergridbuttons:).md)

### Instance Properties

- [headerGridButtons](carplay/cplisttemplate/headergridbuttons.md)
- [listHeader](carplay/cplisttemplate/listheader.md)
- [showsSpinnerWhileEmpty](carplay/cplisttemplate/showsspinnerwhileempty.md)

### Type Properties

- [maximumGridButtonImageSize](carplay/cplisttemplate/maximumgridbuttonimagesize.md)
- [maximumHeaderGridButtonCount](carplay/cplisttemplate/maximumheadergridbuttoncount.md)

## Relationships

### Inherits From

- [CPTemplate](carplay/cptemplate.md)

### Conforms To

- [CPBarButtonProviding](carplay/cpbarbuttonproviding.md)
- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### General Purpose Templates

- [CPGridTemplate](carplay/cpgridtemplate.md)
- [CPTabBarTemplate](carplay/cptabbartemplate.md)
- [CPTemplate](carplay/cptemplate.md)
- [CPBarButtonProviding](carplay/cpbarbuttonproviding.md)
