Skip to content

Tabs

<bh-tabs> | BharatTabs

Tabs component provides a way to organize content into multiple sections that can be displayed one at a time.

Open in flex-shrink: 0; flex-shrink: 0;
Home
Profile
Settings
Help
Welcome to the Home tab content!
This is your Profile information.
Adjust your application Settings here.
Need Help? Contact support.

Basic Usage

Open in flex-shrink: 0; flex-shrink: 0;
Home
Profile
Settings
Help
Welcome to the Home tab content!
This is your Profile information.
Adjust your application Settings here.
Need Help? Contact support.

Variants

Use the variant attribute to set different tab styles.

Open in flex-shrink: 0; flex-shrink: 0;

Default

Tab 1
Content for Tab 1
Tab 2
Content for Tab 2

Pills

Tab 1
Content for Tab 1
Tab 2
Content for Tab 2

Tab Positions

Control the position of the tab list using the tabListPosition property.

Open in flex-shrink: 0; flex-shrink: 0;

Bottom

Tab 1
Content for Tab 1
Tab 2
Content for Tab 2

Start

Tab 1
Tab 2
Content for Tab 1
Content for Tab 2

End

Tab 1
Content for Tab 1
Tab 2
Content for Tab 2

Contained

Control the size of tabs using the size property.

Open in flex-shrink: 0; flex-shrink: 0;
Features

Examples

Documentation

Key Features

  • Multiple tab styles (underline, pills, contained)
  • Responsive design
  • Vertical and horizontal layouts
  • Customizable with CSS variables
  • Fully accessible
  • Animation support

Usage Examples

The Bharat UI Tab Switcher can be used in a variety of contexts:

  • Navigation menus
  • Content organization
  • Form steps
  • Dashboard sections
  • Product details/specifications

Documentation

Refer to our documentation for complete usage guidelines:

 bsdfhbdjbvkjsbdv.kjbsfdkjv

Properties

Attribute / PropertyTypeDescription
variantstringChanges the visual style of the tabs. Example values: "default", "pills", "contained".
alignmentstringControls the alignment of the tabs. Options: "start", "center", "end", "stretch".
activeTabnumberThe index of the currently active tab.
animatedbooleanEnables or disables animation during tab switching.
tabListPositionstringDetermines the position of the tab list. Values: "top", "bottom", "start", "end".
sizestringOptional size setting for styling. Options could be "small", "medium", "large".
tabsarrayInternally generated list of tabs parsed from the tab slot content. Not passed directly.

Named Slots

Slot NameDescription
tabEach tab trigger should be slotted with this name. Use multiple elements inside this slot for each tab label/button.
panel-0Content to show when the first tab (index 0) is active.
panel-1Content to show when the second tab (index 1) is active.
panel-2Content for the third tab, and so on. Ensure the slot name matches the tab index.