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>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="container bootstrap snippets bootdey">
<div class="row">
<div class="col-md-5">
<div class="widget-head-color-box lazur-bg p-lg text-center">
<div class="m-b-md">
<h2 class="font-bold no-margins">
Alex Smith
</h2>
<small>Founder of Mysite</small>
</div>
<img src="https://bootdey.com/img/Content/user_1.jpg" class="img-circle circle-border m-b-md" alt="profile"/>
<div>
<span>100 Tweets</span> |
<span>350 Following</span> |
<span>610 Followers</span>
</div>
</div>
<div class="widget-text-box">
<h4 class="media-heading">Alex Smith</h4>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
<div class="text-right">
<a class="btn btn-xs btn-default"><i class="fa fa-thumbs-up"></i> Like </a>
<a class="btn btn-xs btn-primary"><i class="fa fa-heart"></i> Love</a>
<a class="btn btn-xs btn-success"><i class="fa fa fa-envelope"></i> Message</a>
<a class="btn btn-xs btn-info"><i class="fa fa fa-phone"></i> Call</a>
</div>
</div>
</div>
<div class="col-md-5">
<div class="widget-head-color-box red-bg p-lg text-center">
<div class="m-b-md">
<h2 class="font-bold no-margins">
Barbao Smith
</h2>
<small>Founder of something</small>
</div>
<img src="https://bootdey.com/img/Content/user_3.jpg" class="img-circle circle-border m-b-md" alt="profile"/>
<div>
<span>100 Tweets</span> |
<span>350 Following</span> |
<span>610 Followers</span>
</div>
</div>
<div class="widget-text-box">
<h4 class="media-heading">Barbao Smith</h4>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
<div class="text-right">
<a class="btn btn-xs btn-default"><i class="fa fa-thumbs-up"></i> Like </a>
<a class="btn btn-xs btn-primary"><i class="fa fa-heart"></i> Love</a>
<a class="btn btn-xs btn-success"><i class="fa fa fa-envelope"></i> Message</a>
<a class="btn btn-xs btn-info"><i class="fa fa fa-phone"></i> Call</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;}
.p-lg {
padding: 30px;
}
.lazur-bg {
background-color: #23c6c8;
color: #ffffff;
}
.red-bg {
background-color: #ed5565;
color: #ffffff;
}
.navy-bg {
background-color: #1ab394;
color: #ffffff;
}
.yellow-bg {
background-color: #f8ac59;
color: #ffffff;
}
.widget-head-color-box {
border-radius: 5px 5px 0px 0px;
margin-top: 10px;
}
.m-b-md {
margin-bottom: 20px;
}
.no-margins {
margin: 0 !important;
}
.font-bold {
font-weight: 600;
}
img.circle-border {
border: 6px solid #FFFFFF;
border-radius: 50%;
}
.widget-text-box {
padding: 20px;
border: 1px solid #e7eaec;
background: #ffffff;
}
.media-heading {
margin-top: 0;
margin-bottom: 5px;
}