# Chip

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/Chip.java+class:androidx.car.app.model.Chip) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

*** ** * ** ***


```
@ExperimentalCarApi
@CarProtocol
@RequiresCarApi(value = 9)
class Chip : Item
```

<br />

*** ** * ** ***

A Chip is a toggle-like button with text and/or leading/trailing icon(s).

Chips can, for example, be used to filter items in a `https://developer.android.com/reference/kotlin/androidx/car/app/model/SectionedItemTemplate` when clicked on. A chip's style, content, and selected state can be changed in response to a user click.

## Summary

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

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Chip#equals(java.lang.Object)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIcon?` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Chip#getEndIcon()()` Returns the end icon of the chip, or `null` if not set. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/OnClickDelegate?` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Chip#getOnClickDelegate()()` Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/OnClickDelegate` to be called when the chip is clicked. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIcon?` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Chip#getStartIcon()()` Returns the start icon of the chip, or `null` if not set. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/ChipStyle?` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Chip#getStyle()()` Returns the style of the chip, 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/Chip#getTitle()()` Returns the title of the chip, or `null` if not set. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Chip#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Chip#isSelected()()` Returns whether the chip is selected. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/Chip#toString()()` |

## Public functions

### equals

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

### getEndIcon

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

```
fun getEndIcon(): CarIcon?
```

Returns the end icon of the chip, or `null` if not set.

### getOnClickDelegate

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

```
fun getOnClickDelegate(): OnClickDelegate?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/OnClickDelegate` to be called when the chip is clicked.

### getStartIcon

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

```
fun getStartIcon(): CarIcon?
```

Returns the start icon of the chip, or `null` if not set.

### getStyle

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

```
fun getStyle(): ChipStyle?
```

Returns the style of the chip, or `null` if not set.

### getTitle

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

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

Returns the title of the chip, or `null` if not set.

### hashCode

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

### isSelected

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

```
fun isSelected(): Boolean
```

Returns whether the chip is selected.

### toString

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