Search the documentation

Type to search page titles, component names and descriptions.

    Navigation

    NavList

    A vertical list of destinations with an active item.

    import { NavItem, NavList } from 'faifo-design'

    NavList renders a labelled list of NavItem links, one of which is current. It is the primitive under local navigation: the sections of a settings area, the views of a module.

    #When to use

    • Use AppNavigation for the application's main navigation; use NavList for navigation local to a region.
    • An item is a link. A choice that changes what one screen shows is Tabs or a filter.

    #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>
            }
          />,
        ]}
      />
    )

    #API

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

    #NavItemComponent

    PropertyDescriptionTypeDefault
    labelrequired–string–
    hrefrequired–string–
    leading–JSXChild–
    count–number | string–
    active–boolean–

    #NavListComponent

    PropertyDescriptionTypeDefault
    labelrequired–string–
    itemsrequired–readonly NavItemProps[]–

    #Types

    #NavItemProps

    The properties of NavItem, listed above.