Black Lives Matter.Support the Equal Justice Initiative.
reactstrap
  • Components
  • Utilities
  • GitHub
  • Premium Themes

Components

  • Alerts
  • Badge
  • Breadcrumbs
  • Button Dropdown
  • Button Group
  • Buttons
  • Card
  • Carousel
  • Collapse
  • Dropdowns
  • Fade
  • Form
  • Input Group
  • Jumbotron
  • Layout
  • List
  • List Group
  • Media
  • Modals
  • Navbar
  • Navs
  • Pagination
  • Popovers
  • Progress
  • Spinners
  • Tables
  • Tabs
  • Toasts
  • Tooltips

Tabs


  • Tab1
  • More Tabs

Tab 1 Contents

Special Title Treatment

With supporting text below as a natural lead-in to additional content.

Special Title Treatment

With supporting text below as a natural lead-in to additional content.

import React, { useState } from 'react';
import { TabContent, TabPane, Nav, NavItem, NavLink, Card, Button, CardTitle, CardText, Row, Col } from 'reactstrap';
import classnames from 'classnames';

const Example = (props) => {
  const [activeTab, setActiveTab] = useState('1');

  const toggle = tab => {
    if(activeTab !== tab) setActiveTab(tab);
  }

  return (
    <div>
      <Nav tabs>
        <NavItem>
          <NavLink
            className={classnames({ active: activeTab === '1' })}
            onClick={() => { toggle('1'); }}
          >
            Tab1
          </NavLink>
        </NavItem>
        <NavItem>
          <NavLink
            className={classnames({ active: activeTab === '2' })}
            onClick={() => { toggle('2'); }}
          >
            More Tabs
          </NavLink>
        </NavItem>
      </Nav>
      <TabContent activeTab={activeTab}>
        <TabPane tabId="1">
          <Row>
            <Col sm="12">
              <h4>Tab 1 Contents</h4>
            </Col>
          </Row>
        </TabPane>
        <TabPane tabId="2">
          <Row>
            <Col sm="6">
              <Card body>
                <CardTitle>Special Title Treatment</CardTitle>
                <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
                <Button>Go somewhere</Button>
              </Card>
            </Col>
            <Col sm="6">
              <Card body>
                <CardTitle>Special Title Treatment</CardTitle>
                <CardText>With supporting text below as a natural lead-in to additional content.</CardText>
                <Button>Go somewhere</Button>
              </Card>
            </Col>
          </Row>
        </TabPane>
      </TabContent>
    </div>
  );
}

export default Example;

Deploys by Netlify