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 bootstrap snippets bootdey">
<div class="row">
<div class="col-sm-6 col-xs-12">
<div class="panel panel-default">
<div class="panel-body bg-primary">
<h2 class="text-thin mt">New contacts</h2>
<div class="clearfix">
<div class="pull-right">
<ul class="list-inline m0">
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar2.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar3.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar4.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="" class="v-middle">
<strong>+7</strong>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-xs-12">
<div class="panel panel-default">
<div class="panel-body bg-danger">
<h2 class="text-thin mt">New contacts</h2>
<div class="clearfix">
<div class="pull-right">
<ul class="list-inline m0">
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar5.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar6.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar7.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar8.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="" class="v-middle">
<strong>+7</strong>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-xs-12">
<div class="panel panel-default">
<div class="panel-body bg-warning">
<h2 class="text-thin mt">New contacts</h2>
<div class="clearfix">
<div class="pull-right">
<ul class="list-inline m0">
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar1.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar2.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar3.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar4.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="" class="v-middle">
<strong>+7</strong>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-xs-12">
<div class="panel panel-default">
<div class="panel-body bg-success">
<h2 class="text-thin mt">New contacts</h2>
<div class="clearfix">
<div class="pull-right">
<ul class="list-inline m0">
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar5.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar6.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar7.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="">
<img src="https://bootdey.com/img/Content/avatar/avatar8.png" alt="Follower" class="img-responsive img-circle thumb24"/>
</a>
</li>
<li class="p0">
<a href="" class="v-middle">
<strong>+7</strong>
</a>
</li>
</ul>
</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{
margin-top:20px;
}
.panel {
margin-bottom: 19px;
background-color: #fff;
border: 1px solid transparent;
border-radius: 4px;
-webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,.26);
box-shadow: 0 2px 5px 0 rgba(0,0,0,.26);
}
.text-thin {
font-weight: 100!important;
}
.mt, .mv {
margin-top: 10px!important;
}
.h2, h2 {
font-size: 27px;
}
.m0 {
margin: 0!important;
}
.list-inline>li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
}
.p0 {
padding: 0!important;
}
.thumb24 {
width: 24px!important;
height: 24px!important;
line-height: 24px!important;
}
.bg-primary a {
color: #c5cae9;
}
.v-middle, [slider], slider {
vertical-align: middle;
}