# Tab

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/Tab.java+class:androidx.car.app.model.Tab) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

*** ** * ** ***


```
@CarProtocol
@RequiresCarApi(value = 6)
class Tab : Content
```

<br />

*** ** * ** ***

Represents a tab with a title and an image. `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab` instances are used by TabTemplate to display tab headers.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab.Builder` A builder of `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab#equals(java.lang.Object)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab#getContentId()()` Returns the content ID associated with the tab. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIcon` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab#getIcon()()` Returns the image to display in the tab. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/TabStyle?` | `@https://developer.android.com/reference/kotlin/androidx/car/app/annotations/ExperimentalCarApi @https://developer.android.com/reference/kotlin/androidx/car/app/annotations/RequiresCarApi(value = 9) https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab#getStyle()()` Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/TabStyle` of the container or `null` if not set. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab#getTitle()()` Returns the title of the tab. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab#toString()()` |

## Public functions

### equals

```
fun equals(other: Any?): Boolean
```

### getContentId

```
fun getContentId(): String
```

Returns the content ID associated with the tab.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab.Builder#setContentId(java.lang.String)` |   |

### getIcon

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
fun getIcon(): CarIcon
```

Returns the image to display in the tab.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab.Builder#setIcon(androidx.car.app.model.CarIcon)` |   |

### getStyle

Added in [1.9.0-alpha03](https://developer.android.com/jetpack/androidx/releases/car-app#1.9.0-alpha03)

```
@ExperimentalCarApi
@RequiresCarApi(value = 9)
fun getStyle(): TabStyle?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/TabStyle` of the container or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab.Builder#setStyle(androidx.car.app.model.TabStyle)` |   |

### getTitle

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
fun getTitle(): CarText
```

Returns the title of the tab.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/Tab.Builder#setTitle(java.lang.CharSequence)` |   |

### hashCode

```
fun hashCode(): Int
```

### toString

```
fun toString(): String
```