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">
<div class="col-xl-12 mb-3 mb-lg-5">
<div class="card">
<div class="d-flex card-header justify-content-between">
<h5 class="me-3 mb-0">Top Customers</h5>
<a href="#!.html">View All</a>
</div>
<div class="card-body">
<ul class="list-group list-group-flush">
<li class="list-group-item pt-0">
<div class="d-flex align-items-center">
<div class="flex-shrink-0 me-3">
<img src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="" class="avatar rounded-circle" />
</div>
<div class="flex-grow-1">
<h6 class="mb-0">Inara Britt</h6>
<p class="mb-0 text-muted">Georgia, USA</p>
</div>
<div class="flex-shrink-0 text-end">
<span>
$927.00
</span>
</div>
</div>
</li>
<li class="list-group-item">
<div class="d-flex align-items-center">
<div class="flex-shrink-0 me-3">
<img src="https://bootdey.com/img/Content/avatar/avatar2.png" alt="" class="avatar rounded-circle" />
</div>
<div class="flex-grow-1">
<h6 class="mb-0">Eduard Franz</h6>
<p class="mb-0 text-muted">London, UK</p>
</div>
<div class="flex-shrink-0 text-end">
<span>
$916.00
</span>
</div>
</div>
</li>
<li class="list-group-item">
<div class="d-flex align-items-center">
<div class="flex-shrink-0 me-3">
<img src="https://bootdey.com/img/Content/avatar/avatar3.png" alt="" class="avatar rounded-circle" />
</div>
<div class="flex-grow-1">
<h6 class="mb-0">Gianluca Darby</h6>
<p class="mb-0 text-muted">São Paulo, Brazil</p>
</div>
<div class="flex-shrink-0 text-end">
<span>
$896.50
</span>
</div>
</div>
</li>
<li class="list-group-item">
<div class="d-flex align-items-center">
<div class="flex-shrink-0 me-3">
<img src="https://bootdey.com/img/Content/avatar/avatar4.png" alt="" class="avatar rounded-circle" />
</div>
<div class="flex-grow-1">
<h6 class="mb-0">Milana Myles</h6>
<p class="mb-0 text-muted">Marseille, France</p>
</div>
<div class="flex-shrink-0 text-end">
<span>
$874.50
</span>
</div>
</div>
</li>
<li class="list-group-item pb-0">
<div class="d-flex align-items-center">
<div class="flex-shrink-0 me-3">
<img src="https://bootdey.com/img/Content/avatar/avatar5.png" alt="" class="avatar rounded-circle" />
</div>
<div class="flex-grow-1">
<h6 class="mb-0">Taisiia Oluchi</h6>
<p class="mb-0 text-muted">Durban, SA</p>
</div>
<div class="flex-shrink-0 text-end">
<span>
$857.50
</span>
</div>
</div>
</li>
</ul>
</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{margin-top:20px;
background:#EDF1F9;
}
.card {
box-shadow: 0 20px 27px 0 rgb(0 0 0 / 5%);
}
.avatar {
width: 3rem;
height: 3rem;
font-size: .765625rem;
}
a {
text-decoration:none;
}