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-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar6.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Nielsen Cobb</h5>
<p class="card-text text-uppercase text-muted">Memora</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (851) 552-2735
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</div>
</div>
</div>
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar7.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Margret Cote</h5>
<p class="card-text text-uppercase text-muted">Zilidium</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (893) 532-2218
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</div>
</div>
</div>
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar8.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Rachel Vinson</h5>
<p class="card-text text-uppercase text-muted">Chorizon</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (891) 494-2060
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</div>
</div>
</div>
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar1.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Gabrielle Aguirre</h5>
<p class="card-text text-uppercase text-muted">Comverges</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (805) 459-3869
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</div>
</div>
</div>
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar2.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Spears Collier</h5>
<p class="card-text text-uppercase text-muted">Remold</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (910) 555-2436
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</div>
</div>
</div>
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar3.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Keisha Thomas</h5>
<p class="card-text text-uppercase text-muted">Euron</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (958) 405-3392
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</div>
</div>
</div>
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar4.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Elisabeth Key</h5>
<p class="card-text text-uppercase text-muted">Netagy</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (900) 421-2096
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</div>
</div>
</div>
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar6.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Patel Mack</h5>
<p class="card-text text-uppercase text-muted">Zedalis</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (800) 460-2720
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</div>
</div>
</div>
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar5.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Erika Whitaker</h5>
<p class="card-text text-uppercase text-muted">Uniworld</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (911) 484-3333
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</div>
</div>
</div>
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar2.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Meyers Swanson</h5>
<p class="card-text text-uppercase text-muted">Candecor</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (999) 404-3297
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</div>
</div>
</div>
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar7.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Townsend Sloan</h5>
<p class="card-text text-uppercase text-muted">Rameon</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (978) 563-2964
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</div>
</div>
</div>
<div class="col-md-6 col-xl-4">
<div class="card">
<div class="card-body">
<div class="media align-items-center"><span style={{/*background-image: url(https://bootdey.com/img/Content/avatar/avatar1.png)*/}} class="avatar avatar-xl mr-3"></span>
<div class="media-body overflow-hidden">
<h5 class="card-text mb-0">Millicent Henry</h5>
<p class="card-text text-uppercase text-muted">Balooba</p>
<p class="card-text">
[email protected]<br/><abbr title="Phone">P: </abbr>+1 (863) 585-3988
</p>
</div>
</div><a href="#/" class="tile-link"></a>
</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.avatar-xl {
width: 5rem;
height: 5rem;
}
.avatar {
width: 2rem;
height: 2rem;
line-height: 2rem;
border-radius: 50%;
display: inline-block;
background: #ced4da no-repeat center/cover;
position: relative;
text-align: center;
color: #868e96;
font-weight: 600;
vertical-align: bottom;
}
.card {
background-color: #fff;
border: 0 solid #eee;
border-radius: 0;
}
.card {
margin-bottom: 30px;
-webkit-box-shadow: 2px 2px 2px rgba(0,0,0,0.1), -1px 0 2px rgba(0,0,0,0.05);
box-shadow: 2px 2px 2px rgba(0,0,0,0.1), -1px 0 2px rgba(0,0,0,0.05);
}
.card-body {
padding: 1.25rem;
}
.tile-link {
position: absolute;
cursor: pointer;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 30;
}