---
title: "init(title:textStyle:handler:)"
framework: carplay
role: symbol
role_heading: Initializer
path: "carplay/cptextbutton/init(title:textstyle:handler:)"
---

# init(title:textStyle:handler:)

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

## Declaration

```swift
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.
