Tab
Creates a tab to organize content on different screens.
Read time 7 minutesLast updated 2 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: VisualElement
- Implements: IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler
public class Tab : VisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler
Remarks
A Tab has a header that can respond to pointer and mouse events. The header can hold an icon, a label, or both. The Tab content container can hold anything inside of it giving more flexibility to customize its layout.
For more information, refer to UXML element Tab.
Static Fields
Value | Description |
|---|---|
| closeableUssClassName | The USS class name for a closeable tab. |
| closeButtonUssClassName | The USS class name for close button in closable tabs. |
| contentUssClassName | USS class name of container element of this type. |
| draggingUssClassName | USS class name for the dragging state of this type. |
| reorderableItemHandleBarUssClassName | USS class name for drag handlebar in reorderable tabs. |
| reorderableItemHandleUssClassName | USS class name for drag handle in reorderable tabs. |
| reorderableUssClassName | USS class name for reorderable tab elements. |
| tabHeaderEmptyImageUssClassName | USS class name for the icon inside the header when the value is null. |
| tabHeaderEmptyLabeUssClassName | USS class name for the label of the header when the value is empty or null. |
| tabHeaderImageUssClassName | USS class name for the icon inside the header. |
| tabHeaderLabelUssClassName | USS class name for the label of the header. |
| tabHeaderStandaloneImageUssClassName | USS class name for the icon inside the header when the label is empty or null. |
| tabHeaderUnderlineUssClassName | USS class name for the active state underline of the header. |
| tabHeaderUssClassName | USS class name for the header of this type. |
| ussClassName | USS class name of elements of this type. |
Constructors
Constructor | Description |
|---|---|
| Tab() | Constructs a Tab. |
| Tab(System.String) | Constructs a Tab. |
| Tab(System.String,UnityEngine.UIElements.Background) | Constructs a Tab. |
| Tab(UnityEngine.UIElements.Background) | Constructs a Tab. |
Properties
Property | Description |
|---|---|
| closeable | A property that adds the ability to close tabs. |
| contentContainer | The container for the content of the Tab. |
| iconImage | Sets the icon for the Tab's header. |
| label | Sets the label of the Tab's header. |
| tabHeader | Returns the Tab's header. |
Events
Member | Description |
|---|---|
| closed | This event is called when a tab has been closed. |
| closing | This event is called before a tab is closed. Return true if the tab can be closed. |
| selected | This event is called when a tab has been selected. |