Tabs

Tabs props

NameTypeDescription
activeTabKeystring | numberActive tab number
childrenReact.ReactNodeTabs
onChange(ev: ChangeEvent) => voidTabs change handler
shouldScrollTabsbooleanHorizontal tabs scroll
tabContentNodeHTMLElement | nullDOM-node to put tab content in
themePartialGlobalDefaultTheme[ typeof COMPONENTS_NAMESPACES.tabs ]...
_[className]
[x: string]: unknown
E.g.: _w-48 adds a css class w-48 to the component's outer wrapper.

Tab props

NameTypeDescription
childrenReact.ReactNodeTab content
isDisabledbooleanIn case you want the tab to be disabled
tabKeystring | numberTab number, should start from 0
themePartialGlobalDefaultTheme[ typeof COMPONENTS_NAMESPACES.tabs ]...
titlestring | React.ReactNodeTab title
_[className]
[x: string]: unknown
E.g.: _w-48 adds a css class w-48 to the component's outer wrapper.

() => {
  const [selected, setSelected] = React.useState(0);

  return (
    <L.Tabs
      activeTabKey={selected}
      onChange={(ev) => setSelected(ev.component.value)}
    >
      <L.Tab title={'Tab 1'} tabKey={0}>
        <div className='p-4'>Tab 1 content</div>
      </L.Tab>
      <L.Tab title={'Tab 2'} tabKey={1}>
        <div className='p-4'>Tab 2 content</div>
      </L.Tab>
      <L.Tab title={'Tab 3'} tabKey={2}>
        <div className='p-4'>Tab 3 content</div>
      </L.Tab>
    </L.Tabs>
  );
};