Skip to main content

Components

Tab Bar

Displays a tab bar to switch different views

banner-Tab Bar
Square Icon

Selected Theme

Select brand or tribe name to preview style

Default

Usage

Tabs organize content across different screens, data sets, and other interactions.

import { TabItem, TabWrapper } from 'legion-ui';

Variant

Horizontal

Doing so with Horizontal orientation by parsing horizontal value to the variant property.

import React from "react";
import { Card, TabWrapper, TabItem } from "legion-ui";
import { navigate } from "gatsby";
const TabbarHorizontal = () => {
const handleClickTab = () => navigate("https://legion.telkom.design/");
return (
<div style={{ marginBottom: "30px", width: "630px" }}>
<h4>Horizontal</h4>

Vertical

You can also have vertical Tab Bar and expect results! Give the variant property a value of vertical.

import React from "react";
import { Card, TabWrapper, TabItem } from "legion-ui";
const TabbarVertical = () => {
return (
<div style={{ marginBottom: '30px', width: '630px' }}>
<h4> Vertical </h4>
<Card style={{ paddingLeft: '24px' }}>
<TabWrapper style={{ marginRight: '24px' }} variant="vertical" tabName="tabTwo">

Props

TabWrapper

propertypropTyperequireddefaultdescription
tabNamestring-Sets and identify the name of Tab Bar
varianthorizontal | vertical | -horizontalSets position of the Tab Bar

TabItem

propertypropTyperequireddefaultdescription
badgeNumberstring--Show badge number to the right side of Tab Bar item
iconIconName from react-feather--Sets icon of Tab Bar item
idstring-Sets id of Tab Bar item
isActiveboolean-falseSets status of Tab Bar item
isDisabledboolean-falseSets disable state to a Tab Bar item
labelstring--Sets label of Tab Bar item
onClick(e:React.ChangeEvent<HTMLInputElement>) => void--Define tab bar onClick event. This will turn tab bar into clickable mode (pressed state)