I have a requirement to create a step component using React Bootstrap 5. Here I am using the Tabs component to achieve it. How do add Previous and Next buttons for controlling Tabs? The functionality is to enable the Next Tab using the Next button on condition and the Previous button is just to visit the previous Tab.
import React from 'react';
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import { Tabs, Tab, Row, Button, Col, Container } from "react-bootstrap";
import Home from './Components/TabComponents/Home';
import Profile from './Components/TabComponents/Profile';
import Contact from './Components/TabComponents/Contact';
export default function App() {
return (
<>
<Container>
<Row>
<Col>
<Tabs defaultActiveKey={"home"} id="controlled-tab-example">
<Tab eventKey="home" title="Home" >
<Home />
</Tab>
<Tab eventKey="profile" title="Profile" disabled>
<Profile />
</Tab>
<Tab eventKey="contact" title="Contacts" disabled>
<Contact />
</Tab>
</Tabs>
</Col>
</Row>
<Button className='success'>Prev</Button>
<Button className='success'>Next</Button>
</Container>
</>
);
}