1. First, we need fresh reactjs setup, and for that, we need to run below commands into out terminal, and also we should have latest node version installed on our system:
npx create-react-app my-awesome-project
cd my-awesome-project
npm start
2. Now we need to run below commands into our project terminal to get bootstrap and related modules into our reactjs application:
npm install [email protected] --save
npm start //For start project again
3. Finally for the main output, we need to add below code into our my-awesome-project/src/App.js file or if you have fresh setup then you can replace my-awesome-project/src/App.js file code with below code:
import React from 'react';
import './App.css';
import 'bootstrap/dist/css/bootstrap.min.css';
function App() {
return (
<div>
<div class="container">
<div class="row gx-4">
<div class="col-sm-12">
<div class="card mb-4">
<div class="card-header">
<h5 class="card-title text-center">My Weekly Diet Plan</h5>
</div>
<div class="card-body">
<div class="custom-tabs-container">
<ul class="nav nav-tabs justify-content-center" id="customTab4" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="tab-oneA" data-bs-toggle="tab" href="#oneA" role="tab" aria-controls="oneA" aria-selected="true">Sunday</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="tab-twoA" data-bs-toggle="tab" href="#twoA" role="tab" aria-controls="twoA" aria-selected="false" tabindex="-1">Monday</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="tab-threeA" data-bs-toggle="tab" href="#threeA" role="tab" aria-controls="threeA" aria-selected="false" tabindex="-1">Tuesday</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="tab-fourA" data-bs-toggle="tab" href="#fourA" role="tab" aria-controls="fourA" aria-selected="false" tabindex="-1">Wednesday</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="tab-fiveA" data-bs-toggle="tab" href="#fiveA" role="tab" aria-controls="fiveA" aria-selected="false" tabindex="-1">Thursday</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="tab-sixA" data-bs-toggle="tab" href="#sixA" role="tab" aria-controls="sixA" aria-selected="false" tabindex="-1">Friday</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="tab-sevenA" data-bs-toggle="tab" href="#sevenA" role="tab" aria-controls="sevenA" aria-selected="false" tabindex="-1">Saturday</a>
</li>
</ul>
<div class="tab-content" id="customTabContent">
<div class="tab-pane fade show active" id="oneA" role="tabpanel" aria-labelledby="tab-oneA">
<div class="row gx-4 justify-content-center">
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Greek Green Salad</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">330 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">60 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">10 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Avocado Toast</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">280 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">80 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">30 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Beef Stack</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">480 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">90 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">20 g</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="twoA" role="tabpanel" aria-labelledby="tab-twoA">
<div class="row gx-4 justify-content-center">
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Greek Green Salad</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">330 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">60 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">10 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Avocado Toast</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">280 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">80 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">30 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Beef Stack</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">480 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">90 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">20 g</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="threeA" role="tabpanel" aria-labelledby="tab-threeA">
<div class="row gx-4 justify-content-center">
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Greek Green Salad</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">330 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">60 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">10 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Avocado Toast</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">280 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">80 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">30 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Beef Stack</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">480 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">90 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">20 g</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="fourA" role="tabpanel" aria-labelledby="tab-fourA">
<div class="row gx-4 justify-content-center">
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Greek Green Salad</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">330 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">60 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">10 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Avocado Toast</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">280 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">80 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">30 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Beef Stack</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">480 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">90 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">20 g</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="fiveA" role="tabpanel" aria-labelledby="tab-fiveA">
<div class="row gx-4 justify-content-center">
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Greek Green Salad</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">330 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">60 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">10 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Avocado Toast</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">280 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">80 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">30 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Beef Stack</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">480 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">90 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">20 g</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="sixA" role="tabpanel" aria-labelledby="tab-sixA">
<div class="row gx-4 justify-content-center">
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Greek Green Salad</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">330 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">60 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">10 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Avocado Toast</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">280 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">80 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">30 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Beef Stack</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">480 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">90 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">20 g</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="sevenA" role="tabpanel" aria-labelledby="tab-sevenA">
<div class="row gx-4 justify-content-center">
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Greek Green Salad</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">330 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">60 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">10 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Avocado Toast</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">280 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">80 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">30 g</span>
</li>
</ul>
</div>
</div>
<div class="col-sm-3 col-12">
<div class="p-3 rounded-2 border rounded-2">
<img src="https://www.bootdey.com/image/280x280/87CEFA/000000" class="img-7x rounded-circle mb-3" alt="Fitness Dashboard"/>
<h6>Beef Stack</h6>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Calories
<span class="badge border border-primary text-primary">480 Kcal</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Protein
<span class="badge border border-primary text-primary">90 g</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Fat
<span class="badge border border-primary text-primary">20 g</span>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
);
}
export default App;
4. Now we need to add below code into our my-awesome-project/src/App.css file :
body{padding-top:20px;
background-color: rgba(235, 238, 255, 1) !important;
}
.card {
border: 0;
}
.card-shadow, .app-footer, .card {
box-shadow: 0px 2px 6px rgba(40, 90, 185, .1);
}
.mb-4 {
margin-bottom: 1.5rem !important;
}
.card-header:first-child {
border-radius: calc(0.5rem - 1px) 0 0;
}
.card-header {
border: 0;
}
.card-header {
padding: 0.725rem 1rem;
margin-bottom: 0;
background-color: #ffffff;
}
.card-body {
flex: 1 1 auto;
padding: 1rem 1rem;
}
.custom-tabs-container .tab-content {
padding: 1.5rem 0 0 0;
}
.custom-tabs-container .nav-tabs {
margin: 0 -16px;
border-bottom: 1px solid #e6e5ef;
}
.justify-content-center {
justify-content: center !important;
}
.custom-tabs-container .nav-tabs .nav-item:first-child {
margin-left: 20px;
}
.custom-tabs-container .nav-tabs .nav-link.active {
border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) #5b4da4;
color: #5b4da4;
background: rgba(0, 0, 0, 0);
border-bottom-width: 3px;
}
.custom-tabs-container .nav-tabs .nav-link {
padding: .5rem 1rem;
}
.img-7x {
width: 7rem;
height: 7rem;
}
.rounded-circle {
border-radius: 50% !important;
}
.mb-3 {
margin-bottom: 1rem !important;
}