Skip to content

Tab

Used to display content in a tabbed interface.

Home tab content
import {
Icon,
Tab,
} from '@fintech-sandpit/ui/react';
import {
faEnvelope,
faHome,
faInfo,
} from '@fortawesome/free-solid-svg-icons';
return (
<Tab.Root>
<Tab.List>
<Tab.Item tab="home">
<Icon
as={faHome}
boxSize="0.75em"
/>
<span>
Home
</span>
</Tab.Item>
<Tab.Item
tab="about"
disabled
>
<Icon
as={faInfo}
boxSize="0.75em"
/>
<span>
About
</span>
</Tab.Item>
<Tab.Item tab="contact">
<Icon
as={faEnvelope}
boxSize="0.75em"
/>
<span>
Contact
</span>
</Tab.Item>
</Tab.List>
<Tab.Pane tab="home">
Home tab content
</Tab.Pane>
<Tab.Pane tab="about">
About tab content
</Tab.Pane>
<Tab.Pane tab="contact">
Contact tab content
</Tab.Pane>
</Tab.Root>
);
NameTypeRequiredDefaultDescription
valuestringThe controlled selected tab value
defaultValuestringThe default value of the selected tab
colorSchemeColorSchemeneutralThe color scheme of the tab
sizeSizemdThe size of the tab
variantTabVariantlineThe variant of the tab
orientationOrientationhorizontalThe orientation of the tab
lazybooleanfalseWhether to lazy load the tab content
NameTypeRequiredDefaultDescription
indicatorbooleanfalseWhether to show the tab indicator
NameTypeRequiredDefaultDescription
tabstringThe tab value
iconIconDefinitionThe icon of the tab
counternumberThe counter of the tab
asChildbooleanfalseWhether to render the tab as a child
NameTypeRequiredDefaultDescription
tabstringYesThe tab value
type ColorScheme = 'neutral' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger'
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
type Orientation = 'horizontal' | 'vertical'
type TabVariant = 'line' | 'subtle' | 'enclosed' | 'outline'