Tabs
The Tabs component organizes content into separate sections, where only one section is visible at a time.
Anatomy
A Tabs component is made up of several key parts:
TabsList – The container that groups all tab triggers together.
TabsTrigger – The clickable element that activates a tab.
TabsContent – The container that holds the content for a tab.
Adding a Tabs Component
To add a Tabs component to your page:
Insert the Tabs component from the Library.
Update the default text in each TabsTrigger to describe their respective content.
Modify the content within each TabsContent as needed.
Guides
Setting the Default Open Tab
By default, the first tab is active. If you want a different tab to be open initially:
Select the Tabs component and go to the Properties Panel.
Add the
defaultValueproperty and set it to the value of the tab you want active (for example, change it from'1'to'2'if you want the second tab open).
Disabling Tabs
To disable a tab, preventing users from selecting it:
Select the desired TabsTrigger.
In the Properties Panel, add the
disabledproperty and set it totrue.
Styling the Tabs
You can customize the Tabs appearance and its subcomponents by adjusting their properties through the Properties Panel:
Tabs: Adjust styles like background color, border, and padding to create a card-like appearance or any other desired look.
TabsList: Modify layout-related properties, such as the gap between tab triggers, background color, and padding.
TabsTrigger: Adjust the look of each tab trigger—set background, border radius, and text styles. For consistency, create a shared class and apply it to all triggers.
TabsContent: Customize active content panels by setting background color, padding, and typography.
Creating Vertical Tabs
If you prefer vertical tabs instead of the default horizontal layout:
Select the Tabs component and navigate to the Properties Panel.
Set the display as flex and add a gap value to create spacing between the tabs list and the content.
Select the TabsList, go to the Properties Panel, and update its direction to “Top to Bottom”.