# TabItem

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/tabs/TabItem.java)

*** ** * ** ***


```
public class TabItem
```

<br />

*** ** * ** ***

TabItem is a special 'view' which allows you to declare tab items for a `https://developer.android.com/reference/com/google/android/material/tabs/TabLayout` within a layout. This view is not actually added to TabLayout, it is just a dummy which allows setting of a tab items's text, icon and custom layout. See TabLayout for more information on how to use it.

ref com.google.android.material.R.styleable#TabItem_android_icon

ref com.google.android.material.R.styleable#TabItem_android_text

ref com.google.android.material.R.styleable#TabItem_android_layout

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/tabs/TabLayout` |   |

## Summary

| ### Public fields |
|---|---|
| `final int` | `https://developer.android.com/reference/com/google/android/material/tabs/TabItem#customLayout()` |
| `final Drawable` | `https://developer.android.com/reference/com/google/android/material/tabs/TabItem#icon()` |
| `final https://developer.android.com/reference/java/lang/CharSequence` | `https://developer.android.com/reference/com/google/android/material/tabs/TabItem#text()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/tabs/TabItem#TabItem(Context)(Context context)` |
| `https://developer.android.com/reference/com/google/android/material/tabs/TabItem#TabItem(Context,AttributeSet)(Context context, AttributeSet attrs)` |

## Public fields

### customLayout

```
public final int customLayout
```

### icon

```
public final Drawable icon
```

### text

```
public final CharSequence text
```

## Public constructors

### TabItem

```
public TabItem(Context context)
```

### TabItem

```
public TabItem(Context context, AttributeSet attrs)
```