FSAI Design System
Components

Tabs

Tabbed navigation for organizing content into panels.

Overview

The Tabs component organizes related content into selectable panels. Each tab can render content via a Component reference or inline content ReactNode.

Basic Usage

import { Tabs } from '@fsai/shared-ui';

<Tabs
  tabs={[
    { id: 'overview', label: 'Overview', content: <OverviewContent /> },
    { id: 'details', label: 'Details', content: <DetailsContent /> },
    { id: 'activity', label: 'Activity', content: <ActivityContent /> },
  ]}
/>

With Component Reference

For lazy-mounted tab panels, use Component instead of content:

<Tabs
  tabs={[
    { id: 'overview', label: 'Overview', Component: OverviewTab },
    { id: 'settings', label: 'Settings', Component: SettingsTab },
  ]}
/>

With Icons and Badges

<Tabs
  tabs={[
    { id: 'inbox', label: 'Inbox', Icon: 'InboxFilled', badge: 3, content: <Inbox /> },
    { id: 'sent', label: 'Sent', Icon: 'Send', content: <Sent /> },
  ]}
/>

Controlled Mode

<Tabs
  tabs={tabs}
  selectedIndex={activeTab}
  onChangeIndex={setActiveTab}
/>

Props

PropTypeDefaultDescription
tabsTabType[]Required. Tab definitions
selectedIndexnumberControlled active tab index
onChangeIndex(index: number) => voidTab change handler
defaultIndexnumber0Initial tab (uncontrolled)
headerRightReactNodeContent rendered right of the tabs
extraButtonsArray<{ label: string; onClick: () => void; icon?: IconName }>Additional action buttons
spreadTabsEvenlyAcrossWidthbooleanfalseEqual-width tabs
panelsClassNamestringClass for the panels container
classNamestringClass for the root element

TabType

FieldTypeRequiredDescription
idstringYesUnique tab identifier
labelstringYesTab label text
ComponentComponentTypeXOR contentLazy-mounted panel component
contentReactNodeXOR ComponentInline panel content
IconComponentType | IconNameNoTab icon
badgenumberNoBadge count
disabledbooleanNoDisables the tab

Guidelines

  • Do use descriptive, short tab labels (1-2 words)
  • Do use Component for heavy content that should be lazy-mounted
  • Do place the most important/default tab first
  • Don't use more than 6-7 tabs — consider a different navigation pattern
  • Don't use tabs for sequential workflows — use Steps instead

On this page