Tabs React Component

Tabs allow to simply switch between different content. Tabs React component represents Tabs component.

Tabs Components

There are following components included:

  • Tabs / F7Tabs
  • Tab / F7Tab

Tabs Properties

PropTypeDescription
<Tabs> properties
animatedbooleanEnables animated tabs
swipeablebooleanEnables swipeable tabs
routablebooleanEnables routable tabs
<Tab> properties
tabActivebooleanDefines currently active/visible tab
idstringTab ID

Tabs Methods

<Tab> methods
.show(animate)Show this tab

Tabs Events

EventDescription
<Tab> events
tabShowEvent will be triggered when Tab becomes visible/active
tabHideEvent will be triggered when Tab becomes invisible/inactive

Switch Tabs

You can control/switch tabs:

Examples

Static Tabs

<Page pageContent={false}>
  <Navbar title="Static Tabs" backLink="Back"></Navbar>
  <Toolbar tabbar bottom>
    <Link tabLink="#tab-1" tabLinkActive>Tab 1</Link>
    <Link tabLink="#tab-2">Tab 2</Link>
    <Link tabLink="#tab-3">Tab 3</Link>
  </Toolbar>
  <Tabs>
    <Tab id="tab-1" className="page-content" tabActive>
      <Block>
        <p>Tab 1 content</p>
        ...
      </Block>
    </Tab>
    <Tab id="tab-2" className="page-content">
      <Block>
        <p>Tab 2 content</p>
        ...
      </Block>
    </Tab>
    <Tab id="tab-3" className="page-content">
      <Block>
        <p>Tab 3 content</p>
        ...
      </Block>
    </Tab>
  </Tabs>
</Page>

Animated Tabs

<Page pageContent={false}>
  <Navbar title="Animated Tabs" backLink="Back"></Navbar>
  <Toolbar tabbar bottom>
    <Link tabLink="#tab-1" tabLinkActive>Tab 1</Link>
    <Link tabLink="#tab-2">Tab 2</Link>
    <Link tabLink="#tab-3">Tab 3</Link>
  </Toolbar>
  <Tabs animated>
    <Tab id="tab-1" className="page-content" tabActive>
      <Block>
        <p>Tab 1 content</p>
        ...
      </Block>
    </Tab>
    <Tab id="tab-2" className="page-content">
      <Block>
        <p>Tab 2 content</p>
        ...
      </Block>
    </Tab>
    <Tab id="tab-3" className="page-content">
      <Block>
        <p>Tab 3 content</p>
        ...
      </Block>
    </Tab>
  </Tabs>
</Page>

Swipeable Tabs

<Page pageContent={false}>
  <Navbar title="Swipeable Tabs" backLink="Back"></Navbar>
  <Toolbar tabbar bottom>
    <Link tabLink="#tab-1" tabLinkActive>Tab 1</Link>
    <Link tabLink="#tab-2">Tab 2</Link>
    <Link tabLink="#tab-3">Tab 3</Link>
  </Toolbar>
  <Tabs swipeable>
    <Tab id="tab-1" className="page-content" tabActive>
      <Block>
        <p>Tab 1 content</p>
        ...
      </Block>
    </Tab>
    <Tab id="tab-2" className="page-content">
      <Block>
        <p>Tab 2 content</p>
        ...
      </Block>
    </Tab>
    <Tab id="tab-3" className="page-content">
      <Block>
        <p>Tab 3 content</p>
        ...
      </Block>
    </Tab>
  </Tabs>
</Page>