Tabs keep related content in a single container that is shown and hidden through navigation.
Read more about when and how to use the Tabs component on the website.
yarn add @hig/tabs @hig/theme-context @hig/theme-data
import Tabs, { Tab } from "@hig/tabs";
<Tabs>
<Tab key="details" label="Details">Details content</Tab>
<Tab key="activities" label="Activities">Activities content</Tab>
<Tab key="inspector" label="Inspector">Inspector content</Tab>
</Tabs>
The visual styles of Tabs
can be customized by its props, available values can be found via:
import {
AVAILABLE_ALIGNMENTS,
AVAILABLE_VARIANTS,
AVAILABLE_ORIENTATIONS,
alignments,
variants,
orientations
} from "@hig/tabs";
Complex tabs are composed of an interactive container, text label, divider and optional close icon. Complex tabs only works when varient
is set to box
or canvas
.
Use the className
prop to pass in a css class name to the outermost container of the component. The class name will also pass down to most of the other styled elements within the component.