Search the documentation

Type to search page titles, component names and descriptions.

    Navigation

    Tabs

    Sibling views of one subject, each with its own URL.

    import { Tab, TabPanel, TabbedView, Tabs } from 'faifo-design'

    Tabs switches between sibling views of the same subject. Each tab is a link, so the selected view is part of the URL. TabbedView is the complete region: one stable tab bar and one TabPanel whose content follows the page scroll.

    #When to use

    • Use tabs for views that are peers: details, lines, history.
    • Do not use tabs for a filter over one view. Periods, statuses and scopes are filters (TimeframeFilter, FilterBar).
    • A tab panel adds no left or right padding; its content owns that.

    #Examples

    Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.

    #Navigation and tabs

    Faifo Blue marks the active item in both vertical and horizontal navigation.

    The active panel owns vertical rhythm and scrolling, without horizontal padding.

    Show codeHide code
    import { Breadcrumbs, Icon, NavList, Stack, TabbedView } from 'faifo-design'
    
    export const Example = () => (
      <Stack
        items={[
          <Breadcrumbs
            label="Current location"
            maxItems={3}
            overflowLabel="Show intermediate locations"
            items={[
              { label: 'Workspace', href: '#navigation-items' },
              { label: 'Sales', href: '#navigation-items' },
              { label: 'South region', href: '#navigation-items' },
              { label: 'Orders' },
            ]}
          />,
          <NavList
            label="Product"
            items={[
              {
                label: 'Details',
                href: '#navigation-items',
                leading: <Icon name="file-text" />,
                active: true,
              },
              {
                label: 'Variants',
                href: '#navigation-items',
                leading: <Icon name="layers-3" />,
                count: 12,
              },
              { label: 'Inventory', href: '#navigation-items', leading: <Icon name="package" /> },
            ]}
          />,
          <TabbedView
            id="catalogue-record-views"
            label="Record views"
            items={[
              { id: 'summary', label: 'Summary', href: '#navigation-items', active: true },
              { id: 'activity', label: 'Activity', href: '#navigation-items', count: 8 },
              { id: 'files', label: 'Files', href: '#navigation-items', count: 3 },
            ]}
            body={<p>The active panel owns vertical rhythm and scrolling, without horizontal padding.</p>}
            extension={
              <a data-ui="tab" href="#navigation-items">
                Extension
              </a>
            }
          />,
        ]}
      />
    )

    #Page scrolling tabs

    Unbounded page content follows the containing page scroll instead of trapping wheel input.

    Use page scrolling for full-page configuration blocks; keep panel scrolling for bounded modals.

    Show codeHide code
    import { TabbedView } from 'faifo-design'
    
    export const Example = () => (
      <TabbedView
        id="catalogue-page-views"
        label="Page views"
        scroll="page"
        items={[{ id: 'settings', label: 'Settings', href: '#navigation-items', active: true }]}
        body={
          <p>
            Use page scrolling for full-page configuration blocks; keep panel scrolling for bounded
            modals.
          </p>
        }
      />
    )

    #API

    Generated from the package source. A property without a description has none in the source yet.

    #TabComponent

    PropertyDescriptionTypeDefault
    idrequired–string–
    labelrequired–string–
    hrefrequired–string–
    countA number, or a bounded label such as "10.000+" when the exact total is not counted.number | string–
    active–boolean–
    elementIdDOM id used to associate this navigation item with the active panel.string–
    controlsId of the panel this navigation item opens.string–

    #TabPanelComponent

    Content associated with route-navigation tabs. It owns scrolling and vertical rhythm, but deliberately adds no left or right padding.

    PropertyDescriptionTypeDefault
    id–string–
    labelledBy–string–
    bodyrequired–JSXChild–
    scrollPage content participates in the containing page's scroll, rather than trapping it.'panel' | 'page'–

    #TabbedViewComponent

    A complete tabbed region with one stable navigation bar and one content panel.

    PropertyDescriptionTypeDefault
    idrequired–string–
    labelrequired–string–
    itemsrequired–readonly TabItem[]–
    bodyrequired–JSXChild–
    contextStable content above the tab bar, such as a record summary or issues.JSXChild–
    extension–JSXChild–
    scrollUse page for unbounded routed content; panel retains bounded modal scrolling.'panel' | 'page'–

    #TabsComponent

    PropertyDescriptionTypeDefault
    idStable id used to associate the active tab with a TabPanel.string–
    labelrequired–string–
    itemsrequired–readonly TabItem[]–
    extension–JSXChild–
    panelIdPanel controlled by these route-navigation tabs.string–

    #Types

    #TabItem

    PropertyDescriptionTypeDefault
    idrequired–string–
    labelrequired–string–
    hrefrequired–string–
    countA number, or a bounded label such as "10.000+" when the exact total is not counted.number | string–
    active–boolean–

    #TabPanelProps

    The properties of TabPanel, listed above.

    #TabProps

    The properties of Tab, listed above.

    #TabbedViewProps

    The properties of TabbedView, listed above.

    #TabsProps

    The properties of Tabs, listed above.