---
title: CPTemplate
framework: carplay
role: symbol
role_heading: Class
path: carplay/cptemplate
---

# CPTemplate

An abstract base class for interface templates.

## Declaration

```swift
@MainActor class CPTemplate
```

## Overview

Overview CPTemplate is an abstract base class for defining CarPlay user interface templates. It provides the common functionality present in all templates. You don’t use this class directly, or create your own subclasses. Instead, you must use one of the prebuilt templates, such as CPListTemplate or CPGridTemplate.

## Topics

### Accessing Template Information

- [userInfo](carplay/cptemplate/userinfo.md)

### Accessing Tab Information

- [tabTitle](carplay/cptemplate/tabtitle.md)
- [tabImage](carplay/cptemplate/tabimage.md)
- [tabSystemItem](carplay/cptemplate/tabsystemitem.md)
- [showsTabBadge](carplay/cptemplate/showstabbadge.md)

### Initializers

- [init(coder:)](carplay/cptemplate/init(coder:).md)

## Relationships

### Inherits From

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

### Inherited By

- [CPActionSheetTemplate](carplay/cpactionsheettemplate.md)
- [CPAlertTemplate](carplay/cpalerttemplate.md)
- [CPContactTemplate](carplay/cpcontacttemplate.md)
- [CPGridTemplate](carplay/cpgridtemplate.md)
- [CPInformationTemplate](carplay/cpinformationtemplate.md)
- [CPListTemplate](carplay/cplisttemplate.md)
- [CPMapTemplate](carplay/cpmaptemplate.md)
- [CPNowPlayingTemplate](carplay/cpnowplayingtemplate.md)
- [CPPointOfInterestTemplate](carplay/cppointofinteresttemplate.md)
- [CPSearchTemplate](carplay/cpsearchtemplate.md)
- [CPTabBarTemplate](carplay/cptabbartemplate.md)
- [CPVoiceControlTemplate](carplay/cpvoicecontroltemplate.md)

### Conforms To

- [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)

## See Also

### General Purpose Templates

- [CPListTemplate](carplay/cplisttemplate.md)
- [CPGridTemplate](carplay/cpgridtemplate.md)
- [CPTabBarTemplate](carplay/cptabbartemplate.md)
- [CPBarButtonProviding](carplay/cpbarbuttonproviding.md)
