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

# NSTabView

A multipage interface that displays one page at a time.

```
class NSTabView
```

## Overview

A tab view contains a row of tabs that give the appearance of folder tabs, as shown in the [Figure 1](/documentation/appkit/nstabview#2555818). The user selects the desired page by clicking the appropriate tab or using the arrow keys to move between pages. Each page displays a view hierarchy provided by your app.

![](images/com.apple.appkit/media-2555818@2x.png)

## Topics

### Handling the Selection of Tabs

[`delegate`](/documentation/AppKit/NSTabView/delegate)

The tab view’s delegate.

[`NSTabViewDelegate`](/documentation/AppKit/NSTabViewDelegate)

The `NSTabViewDelegate` protocol defines the optional methods implemented by delegates of `NSTabView` objects.

### Adding and Removing Tabs

[`-  addTabViewItem:`](/documentation/AppKit/NSTabView/addTabViewItem(_:))

Adds the specified tab item.

[`-  insertTabViewItem:atIndex:`](/documentation/AppKit/NSTabView/insertTabViewItem(_:at:))

Inserts the specified item into the tab view’s array of tab view items at the specified index.

[`-  removeTabViewItem:`](/documentation/AppKit/NSTabView/removeTabViewItem(_:))

Removes the specified item from the tab view’s array of tab view items.

### Accessing Tabs

[`-  indexOfTabViewItem:`](/documentation/AppKit/NSTabView/indexOfTabViewItem(_:))

Returns the index of the specified item in the tab view.

[`-  indexOfTabViewItemWithIdentifier:`](/documentation/AppKit/NSTabView/indexOfTabViewItem(withIdentifier:))

Returns the index of the item that matches the specified identifier or `NSNotFound` if the item is not found.

[`numberOfTabViewItems`](/documentation/AppKit/NSTabView/numberOfTabViewItems)

The number of items in the tab view’s array of tab view items.

[`-  tabViewItemAtIndex:`](/documentation/AppKit/NSTabView/tabViewItem(at:)-7r3at)

Returns the tab view item at `index` in the tab view’s array of items.

[`tabViewItems`](/documentation/AppKit/NSTabView/tabViewItems)

The tab view’s array of tab view items.

### Configuring the Tab Attributes

[`tabViewType`](/documentation/AppKit/NSTabView/tabViewType)

The tab type to display the tabs.

[`TabType`](/documentation/AppKit/NSTabView/TabType)

These constants specify the tab view’s type as used by the [`tabViewType`](/documentation/AppKit/NSTabView/tabViewType) property.

[`tabPosition`](/documentation/AppKit/NSTabView/tabPosition-swift.property)

[`TabPosition`](/documentation/AppKit/NSTabView/TabPosition-swift.enum)

[`tabViewBorderType`](/documentation/AppKit/NSTabView/tabViewBorderType-swift.property)

[`TabViewBorderType`](/documentation/AppKit/NSTabView/TabViewBorderType-swift.enum)

### Selecting a Tab

[`-  selectFirstTabViewItem:`](/documentation/AppKit/NSTabView/selectFirstTabViewItem(_:))

This action method selects the first tab view item.

[`-  selectLastTabViewItem:`](/documentation/AppKit/NSTabView/selectLastTabViewItem(_:))

This action method selects the last tab view item.

[`-  selectNextTabViewItem:`](/documentation/AppKit/NSTabView/selectNextTabViewItem(_:))

This action method selects the next tab view item in the sequence.

[`-  selectPreviousTabViewItem:`](/documentation/AppKit/NSTabView/selectPreviousTabViewItem(_:))

This action method selects the previous tab view item in the sequence.

[`-  selectTabViewItem:`](/documentation/AppKit/NSTabView/selectTabViewItem(_:))

Selects the specified tab view item.

[`-  selectTabViewItemAtIndex:`](/documentation/AppKit/NSTabView/selectTabViewItem(at:))

Selects the tab view item specified by `index`.

[`-  selectTabViewItemWithIdentifier:`](/documentation/AppKit/NSTabView/selectTabViewItem(withIdentifier:))

Selects the tab view item specified by `identifier`.

[`selectedTabViewItem`](/documentation/AppKit/NSTabView/selectedTabViewItem)

The tab view item for the currently selected tab.

[`-  takeSelectedTabViewItemFromSender:`](/documentation/AppKit/NSTabView/takeSelectedTabViewItemFromSender(_:))

Sets the selected tab view item to the selected item obtained from the sender.

### Modifying the Font

[`font`](/documentation/AppKit/NSTabView/font)

The font used for the tab view’s label text.

### Modifying Controls Tint

[`controlTint`](/documentation/AppKit/NSTabView/controlTint)

The tab view’s control tint.

### Manipulating the Background

[`drawsBackground`](/documentation/AppKit/NSTabView/drawsBackground)

A Boolean value that indicates if the tab view draws a background color when its type is `NSNoTabsNoBorder`.

### Determining the Size

[`minimumSize`](/documentation/AppKit/NSTabView/minimumSize)

The minimum size necessary for the tab view to display tabs in a useful way.

[`contentRect`](/documentation/AppKit/NSTabView/contentRect)

The rectangle describing the content area of the tab view.

[`controlSize`](/documentation/AppKit/NSTabView/controlSize)

The size of the tab view.

### Truncating Tab Labels

[`allowsTruncatedLabels`](/documentation/AppKit/NSTabView/allowsTruncatedLabels)

A Boolean value that indicates if the tab view allows truncating for labels that don’t fit on a tab.

### Event Handling

[`-  tabViewItemAtPoint:`](/documentation/AppKit/NSTabView/tabViewItem(at:)-8gnqw)

Returns the tab view item at the specified point.

## Relationships

### Conforms To

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

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

[`NSUserActivityRestoring`](/documentation/AppKit/NSUserActivityRestoring)

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

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

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

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

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

[`NSAnimatablePropertyContainer`](/documentation/AppKit/NSAnimatablePropertyContainer)

[`NSStandardKeyBindingResponding`](/documentation/AppKit/NSStandardKeyBindingResponding)

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

[`NSAppearanceCustomization`](/documentation/AppKit/NSAppearanceCustomization)

[`NSAccessibilityElementProtocol`](/documentation/AppKit/NSAccessibilityElementProtocol)

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

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

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`NSAccessibilityProtocol`](/documentation/AppKit/NSAccessibilityProtocol)

[`NSDraggingDestination`](/documentation/AppKit/NSDraggingDestination)

### Inherits From

[`NSView`](/documentation/AppKit/NSView)

---

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)