class Tabs

Extends:
UIComponent

Description:

A Tabs UI component is a set of linked panels where only one panel is visible at a time, and users can switch between them by clicking tab headers. It’s commonly used to organize related content into separate views. This helps save space and makes navigation more intuitive.

Constructor

constructor()

Creates a new Tabs component.

Parameters:

No parameters

Members

Methods

From this class:

Inherited from UIComponent:

Examples:

// Usage example

// create new Tabs component
this.tabs = new Tabs().addTo(this).position(15, 15, 15, 15).anchor("top right bottom left");

// One way to add a Panel to Tabs
this.loginPanel = new Panel().background(null);
this.tabs.add(this.loginPanel, {text: "Sign In", enabled: true, tooltip: "Log in to your account", icon: "images/user.png"});

// second way to add same panel and options
this.loginPanel = new Panel("Sign In").background(null).icon("images/user.png").addTo(this.tabs);
this.tabs.tooltipAt(0, "Log in to your account");

// third way to add same panel and options
this.loginPanel = new Panel().background(null);
this.tabs.add(this.loginPanel).textAt(0, "Sign In").iconAt(0, "images/user.png").tooltipAt(0, "Log in to your account").enabledAt(0, true);