<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPTextButton/init(title:textStyle:handler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(cs)CPTextButton(im)initWithTitle:textStyle:handler:"
  },
  "title" : "init(title:textStyle:handler:)"
}
-->

# init(title:textStyle:handler:)

Creates a button that displays a title in a specific style.

```
init(title: String, textStyle: CPTextButtonStyle, handler: ((CPTextButton) -> Void)? = nil)
```

## Parameters

`title`

The text that the button displays.

`textStyle`

The style that the button applies to its title.

`handler`

A closure that CarPlay invokes when the user taps the button.

---

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)