add(component, [options], [index])

Class: Tabs.

Description:

Adds a new tab with provided component as the main component of that tab. If options are passed, they will be used for tab text, icon, tooltip, etc.

Parameters:

Name Type Description

component

object

A component that is allowed to be added to Tabs:

[options]

string | object | undefined

Text of the new tab or an object containing one or more options {text:string, icon: string, tooltip: string, enabled: boolean, index: number}.

[index]

number | undefined

Index at which to insert the new tab. Default is last tab.

Returns:

Returns this Tabs component for method chaining.

Type: Tabs

Examples:

// Setting multiple tab options
tabs.add(panel, {text:"Tab Name",icon:"icons/user.png",enabled:true,tooltip:"Create new user"});

// Setting tab name only (as a string)
tabs.add(panel, "Tab Name");

// Setting insert index
tabs.add(panel, "Tab Name", 2);