Version 3.3.1.2

Odin has a dedicated attribute overview with examples

TabGroupAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[Conditional("UNITY_EDITOR")]
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All, AllowMultiple = true, Inherited = true)]
public class TabGroupAttribute : PropertyGroupAttribute, _Attribute, ISubGroupProviderAttribute

TabGroup is used on any property, and organizes properties into different tabs.

Use this to organize different value to make a clean and easy to use inspector.

Inheritance
Remarks

Use groups to create multiple tab groups, each with multiple tabs and even sub tabs.

Example

The following example shows how to create a tab group with two tabs.

public class MyComponent : MonoBehaviour
{
	[TabGroup("First")]
	public int MyFirstInt;

	[TabGroup("First")]
	public int AnotherInt;

	[TabGroup("Second")]
	public int MySecondInt;
}
Example

The following example shows how multiple groups of tabs can be created.

public class MyComponent : MonoBehaviour
{
	[TabGroup("A", "FirstGroup")]
	public int FirstGroupA;

	[TabGroup("B", "FirstGroup")]
	public int FirstGroupB;

	// The second tab group has been configured to have constant height across all tabs.
	[TabGroup("A", "SecondGroup", true)]
	public int SecondgroupA;

	[TabGroup("B", "SecondGroup")]
	public int SecondGroupB;

	[TabGroup("B", "SecondGroup")]
	public int AnotherInt;
}
Example

This example demonstrates how multiple tabs groups can be combined to create tabs in tabs.

public class MyComponent : MonoBehaviour
{
    [TabGroup("ParentGroup", "First Tab")]
    public int A;

    [TabGroup("ParentGroup", "Second Tab")]
    public int B;

    // Specify 'First Tab' as a group, and another child group to the 'First Tab' group.
    [TabGroup("ParentGroup/First Tab/InnerGroup", "Inside First Tab A")]
    public int C;

    [TabGroup("ParentGroup/First Tab/InnerGroup", "Inside First Tab B")]
    public int D;

    [TabGroup("ParentGroup/Second Tab/InnerGroup", "Inside Second Tab")]
    public int E;
}

Constructors

TabGroupAttribute(String, Boolean, Single)
Organizes the property into the specified tab in the default group. Default group name is '_DefaultTabGroup'
public TabGroupAttribute(string tab, bool useFixedHeight = false, float order = 0F)
Parameters
System.String tab

The tab.

System.Boolean useFixedHeight

if set to true [use fixed height].

System.Single order

The order.

TabGroupAttribute(String, String, SdfIconType, Boolean, Single)
Organizes the property into the specified tab in the specified group.
public TabGroupAttribute(string group, string tab, SdfIconType icon, bool useFixedHeight = false, float order = 0F)
Parameters
System.String group

The group to attach the tab to.

System.String tab

The name of the tab.

SdfIconType icon

System.Boolean useFixedHeight

Set to true to have a constant height across the entire tab group.

System.Single order

The order of the group.

TabGroupAttribute(String, String, Boolean, Single)
Organizes the property into the specified tab in the specified group.
public TabGroupAttribute(string group, string tab, bool useFixedHeight = false, float order = 0F)
Parameters
System.String group

The group to attach the tab to.

System.String tab

The name of the tab.

System.Boolean useFixedHeight

Set to true to have a constant height across the entire tab group.

System.Single order

The order of the group.

Fields

DEFAULT_NAME
The default tab group name which is used when the single-parameter constructor is called.
public const string DEFAULT_NAME = "_DefaultTabGroup"
HideTabGroupIfTabGroupOnlyHasOneTab
If true, the tab group will be hidden if it only contains one tab.
public bool HideTabGroupIfTabGroupOnlyHasOneTab
Icon
public SdfIconType Icon
Paddingless
If true, the content of each page will not be contained in any box.
public bool Paddingless
TabId
public string TabId
TabLayouting
Specify how tabs should be layouted.
public TabLayouting TabLayouting
TabName
Name of the tab.
public string TabName
Tabs
Name of all tabs in this group.
public List<TabGroupAttribute> Tabs
TextColor
Supports a variety of color formats, including named colors (e.g. "red", "orange", "green", "blue"), hex codes (e.g. "#FF0000" and "#FF0000FF"), and RGBA (e.g. "RGBA(1,1,1,1)") or RGB (e.g. "RGB(1,1,1)"), including Odin attribute expressions (e.g "@this.MyColor"). Here are the available named colors: black, blue, clear, cyan, gray, green, grey, magenta, orange, purple, red, transparent, transparentBlack, transparentWhite, white, yellow, lightblue, lightcyan, lightgray, lightgreen, lightgrey, lightmagenta, lightorange, lightpurple, lightred, lightyellow, darkblue, darkcyan, darkgray, darkgreen, darkgrey, darkmagenta, darkorange, darkpurple, darkred, darkyellow.
public string TextColor
UseFixedHeight
Should this tab be the same height as the rest of the tab group.
public bool UseFixedHeight

Methods

CombineValuesWith(PropertyGroupAttribute)
protected override void CombineValuesWith(PropertyGroupAttribute other)
Parameters
PropertyGroupAttribute other