<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPGridTemplate",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(cs)CPGridTemplate"
  },
  "title" : "CPGridTemplate"
}
-->

# CPGridTemplate

A template that displays and manages a grid of items.

```
@MainActor class CPGridTemplate
```

## Overview

Use this template to display a grid of items as buttons. When creating the grid template, provide an array of [`CPGridButton`](/documentation/CarPlay/CPGridButton) objects. Each button contains a title, an image, and an optional handler that the system invokes after the user taps the button on the CarPlay screen.

When there are more than eight buttons in the array, the template displays only the first eight. When there are more than four buttons, the template balances the display of the buttons betweem two rows.

## Topics

### Creating a Grid Template

[`-  initWithTitle:gridButtons:`](/documentation/CarPlay/CPGridTemplate/init(title:gridButtons:))

Creates a grid template with a title and a set of buttons.

[`CPGridButton`](/documentation/CarPlay/CPGridButton)

A menu item button displayed on a grid template.

### Getting the Grid Title

[`title`](/documentation/CarPlay/CPGridTemplate/title)

The title shown in the grid template’s navigation bar.

### Getting the Grid Buttons

[`gridButtons`](/documentation/CarPlay/CPGridTemplate/gridButtons)

The array of grid buttons displayed on the template.

### Instance Methods

[`-  updateGridButtons:`](/documentation/CarPlay/CPGridTemplate/updateGridButtons(_:))

[`-  updateTitle:`](/documentation/CarPlay/CPGridTemplate/updateTitle(_:))

## Relationships

### Conforms To

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CPBarButtonProviding`](/documentation/CarPlay/CPBarButtonProviding)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`CPTemplate`](/documentation/CarPlay/CPTemplate)

---

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)