<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTabViewItem",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTabViewItem"
  },
  "title" : "NSTabViewItem"
}
-->

# NSTabViewItem

An item in a tab view.

```
class NSTabViewItem
```

## Overview

An [`NSTabViewItem`](/documentation/AppKit/NSTabViewItem) is a convenient way for presenting information in multiple pages. A tab view is usually distinguished by a row of tabs that give the visual appearance of folder tabs. When the user clicks a tab, the tab view displays a view page provided by your application. A tab view keeps a zero-based array of tab view items, one for each tab in the view.

## Topics

### Creating a Tab View Item

[`-  initWithIdentifier:`](/documentation/AppKit/NSTabViewItem/init(identifier:))

Performs default initialization for the receiver.

### Working with Labels

[`-  drawLabel:inRect:`](/documentation/AppKit/NSTabViewItem/drawLabel(_:in:))

Draws the receiver’s label in `tabRect`, which is the area between the curved end caps.

[`label`](/documentation/AppKit/NSTabViewItem/label)

Sets the label text for the receiver to `label`.

[`-  sizeOfLabel:`](/documentation/AppKit/NSTabViewItem/sizeOfLabel(_:))

Calculates the size of the receiver’s label.

### Checking the Tab Display State

[`tabState`](/documentation/AppKit/NSTabViewItem/tabState)

Returns the current display state of the tab associated with the receiver.

### Assigning an Identifier Object

[`identifier`](/documentation/AppKit/NSTabViewItem/identifier)

Sets the receiver’s optional identifier object to `identifier`.

### Setting the Color

[`color`](/documentation/AppKit/NSTabViewItem/color)

Sets the background color for content in the view.

### Assigning a View

[`view`](/documentation/AppKit/NSTabViewItem/view)

Sets the view associated with the receiver to `view`.

### Setting the Initial First Responder

[`initialFirstResponder`](/documentation/AppKit/NSTabViewItem/initialFirstResponder)

Sets the initial first responder for the view associated with the receiver (the view that is displayed when a user clicks on the tab) to `view`.

### Accessing the Parent Tab View

[`tabView`](/documentation/AppKit/NSTabViewItem/tabView)

Returns the parent tab view for the receiver.

### Getting and Setting Tooltips

[`toolTip`](/documentation/AppKit/NSTabViewItem/toolTip)

Sets the tooltip displayed for the tab view item.

### Constants

[`State`](/documentation/AppKit/NSTabViewItem/State)

These constants describe the current display state of a tab:

### Initializers

[`+  tabViewItemWithViewController:`](/documentation/AppKit/NSTabViewItem/init(viewController:))

### Instance Properties

[`image`](/documentation/AppKit/NSTabViewItem/image)

Gets and set the image for this tab view item. The image may only be used in certain tab view styles and options.

[`viewController`](/documentation/AppKit/NSTabViewItem/viewController)

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`NSCoding`](/documentation/Foundation/NSCoding)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)