Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TabView

Creates a tab view that groups a one or more Tab elements.
Read time 10 minutesLast updated 2 days ago

Definition

[Icon("UIToolkit/Icons/TabView.png")][UxmlElement(null, new Type[] { typeof(Tab) }, libraryPath = "Controls")]public class TabView : VisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle

Remarks

A tab view provides additional functionality to the Tab. It allows a group of tabs to interact between each other by hiding the inactive tabs and displaying the active one. Additionally, it adds the ability to re-order the group of tabs.
For reorderable tabs, it is important to keep the view-data-key unique for the TabView and Tab elements inside of it. The view-data-key helps store the state of the tabs such as the order and state. By having an empty view-data-key, which is the default value, the state of the tabs will not persist when reloading the document.
For more information, refer to UXML element TabView.

Static Fields

Value

Description

contentContainerUssClassNameUSS class name for the content container of this type.
headerContainerClassNameUSS class name for the header container of this type.
nextButtonUssClassNameUSS class name for the scroll next button of this type.
previousButtonUssClassNameUSS class name for the scroll previous button of this type.
reorderableUssClassNameThe USS class name for reorderable tab view.
ussClassNameUSS class name of elements of this type.
verticalUssClassNameThe USS class name for vertical tab view.
viewportUssClassNameUSS class name for the content viewport of this type.

Constructors

Constructor

Description

TabView()Constructs a TabView.

Properties

Property

Description

activeTabProperty that holds the current active tab.
contentContainerThe container for the content of the TabView.
contentViewportRepresents the visible part of contentContainer.
reorderableA property that adds dragging support to tabs.
selectedTabIndexA property that returns the index of current active tab inside a list of available tabs.

Methods

Method

Description

GetTabReturns the tab at the specified index.
GetTabHeaderReturns the tab header at the specified index.
ReorderTabMoves the tab from the specified index to a new index.

Events

Member

Description

activeTabChangedCalled when the active tab is reassigned.
tabClosedRaised when a tab is closed. The first argument is the tab that was closed, the second is the index of the tab that was closed.
tabReorderedRaised when a tab is reordered. The first argument is source index, second is destination index.

Inheritance

Inherited Members