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

# CPGridButton

A menu item button displayed on a grid template.

```
class CPGridButton
```

## Topics

### Creating a Grid Button

[`convenience init(titleVariants: [String], image: UIImage, handler: ((CPGridButton) -> Void)?)`](/documentation/CarPlay/CPGridButton/init(titleVariants:image:handler:))

Creates a grid button with the specified title variants, image, and action handler.

### Controlling the Grid Button

[`var isEnabled: Bool`](/documentation/CarPlay/CPGridButton/isEnabled)

A Boolean value that enables and disables the grid button.

### Obtaining Grid Button Information

[`var titleVariants: [String]`](/documentation/CarPlay/CPGridButton/titleVariants)

An array of title variants for the button.

[`var image: UIImage`](/documentation/CarPlay/CPGridButton/image)

The image displayed on the button.

### Initializers

[`init?(coder: NSCoder)`](/documentation/CarPlay/CPGridButton/init(coder:))

[`init(titleVariants: [String], image: UIImage, messageConfiguration: CPMessageGridItemConfiguration?, handler: ((CPGridButton) -> Void)?)`](/documentation/CarPlay/CPGridButton/init(titleVariants:image:messageConfiguration:handler:))

Initialize a button with a title, image, and message configuration.

### Instance Properties

[`var messageConfiguration: CPMessageGridItemConfiguration?`](/documentation/CarPlay/CPGridButton/messageConfiguration)

### Instance Methods

[`func updateImage(UIImage)`](/documentation/CarPlay/CPGridButton/updateImage(_:))

[`func updateTitleVariants([String])`](/documentation/CarPlay/CPGridButton/updateTitleVariants(_:))

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)