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-4 col-md-4 mb-3 mb-lg-5">
<div class="card overflow-hidden text-center">
<img src="https://www.bootdey.com/image/280x120/6495ED/000000" class="card-img-top img-fluid" alt=""/>
<div class="card-body p-0">
<a href="#!.html" class="avatar xl rounded-circle bg-gray bg-opacity-10 p-1 position-relative mt-n5 d-block mx-auto">
<img src="https://bootdey.com/img/Content/avatar/avatar1.png" class="avatar-img img-fluid rounded-circle" alt=""/>
</a>
<h5 class="mb-0 pt-3">
<a href="#!.html" class="text-reset">Noah Pierre</a>
</h5>
<span class="text-muted small d-block mb-4">Full stack developer</span>
<div class="row mx-0 border-top border-bottom">
<div class="col-6 text-center border-end py-3">
<h5 class="mb-0">2345</h5>
<small class="text-muted">Followers</small>
</div>
<div class="col-6 text-center py-3">
<h5 class="mb-0">54</h5>
<small class="text-muted">Following</small>
</div>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item px-3 d-flex align-items-center justify-content-between">
<span class="text-muted small">Join</span>
<strong>April 2014</strong>
</li>
<li class="list-group-item px-3 d-flex align-items-center justify-content-between">
<span class="text-muted small">Location</span>
<strong>Barcelona, Spain</strong>
</li>
<li class="list-group-item px-3 d-flex align-items-center justify-content-between">
<span class="text-muted small d-flex align-items-center">
<span class="align-middle lh-1 me-1 size-5 border border-4 border-success rounded-circle d-inline-block"></span>
Online
</span>
<div class="text-end">
<a href="#!.html" class="btn btn-sm btn-primary">Follow</a>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="col-xl-4 col-md-4 mb-3 mb-lg-5">
<div class="card overflow-hidden text-center">
<img src="https://www.bootdey.com/image/280x120/FFB6C1/000000" class="card-img-top img-fluid" alt=""/>
<div class="card-body p-0">
<a href="#!.html" class="avatar xl rounded-circle bg-gray bg-opacity-10 p-1 position-relative mt-n5 d-block mx-auto">
<img src="https://bootdey.com/img/Content/avatar/avatar2.png" class="avatar-img img-fluid rounded-circle" alt=""/>
</a>
<h5 class="mb-0 pt-3">
<a href="#!.html" class="text-reset">Noah Pierre</a>
</h5>
<span class="text-muted small d-block mb-4">Full stack developer</span>
<div class="row mx-0 border-top border-bottom">
<div class="col-6 text-center border-end py-3">
<h5 class="mb-0">2345</h5>
<small class="text-muted">Followers</small>
</div>
<div class="col-6 text-center py-3">
<h5 class="mb-0">54</h5>
<small class="text-muted">Following</small>
</div>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item px-3 d-flex align-items-center justify-content-between">
<span class="text-muted small">Join</span>
<strong>April 2014</strong>
</li>
<li class="list-group-item px-3 d-flex align-items-center justify-content-between">
<span class="text-muted small">Location</span>
<strong>Barcelona, Spain</strong>
</li>
<li class="list-group-item px-3 d-flex align-items-center justify-content-between">
<span class="text-muted small d-flex align-items-center">
<span class="align-middle lh-1 me-1 size-5 border border-4 border-success rounded-circle d-inline-block"></span>
Online
</span>
<div class="text-end">
<a href="#!.html" class="btn btn-sm btn-primary">Follow</a>
</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:#eee;
}
.avatar.xl {
width: 5rem;
height: 5rem;
font-size: 1.09375rem;
}
.avatar img {
max-width: 100%;
display: block;
}
.rounded-circle {
border-radius: 50%!important;
}
.rounded-circle {
border-radius: 50%!important;
}
.bg-opacity-10 {
--bs-bg-opacity: 0.1;
}
.bg-gray {
--bs-bg-opacity: 1;
background-color: rgba(var(--bs-gray-rgb),var(--bs-bg-opacity))!important;
}
.p-1 {
padding: 0.25rem!important;
}
.mt-n5 {
margin-top: -1.5rem!important;
}
.mx-auto {
margin-right: auto!important;
margin-left: auto!important;
}
.position-relative {
position: relative!important;
}
.d-block {
display: block!important;
}
a {
color: var(--bs-link-color);
text-decoration: none;
}