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 rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"/>
<div class="container bootstrap snippets bootdey">
<div class="row">
<h2 class="text-primary title"><span class="glyphicon glyphicon-align-justify"></span>User list</h2>
<div class="col-lg-12">
<input type="search" class="form-control" id="input-search" placeholder="Search..." />
</div>
<div class="searchable-container">
<div class="items col-xs-12 col-sm-6 col-md-6 col-lg-6 clearfix">
<div class="info-block block-info clearfix">
<div class="square-box pull-left">
<span class="fa fa-user"></span>
</div>
<h5 class="text-success">Company Name</h5>
<h4>Name: <b>Full name</b></h4>
<p>Title: Manager</p>
<span>Email: [email protected]</span>
</div>
</div>
<div class="items col-xs-12 col-sm-12 col-md-6 col-lg-6 clearfix">
<div class="info-block block-info clearfix">
<div class="square-box pull-left">
<span class="fa fa-user"></span>
</div>
<h5 class="text-success">Company Name</h5>
<h4>Name: <b>Full name</b></h4>
<p>Title: Manager</p>
<span>Email: [email protected]</span>
</div>
</div>
<div class="items col-xs-12 col-sm-12 col-md-6 col-lg-6">
<div class="info-block block-info clearfix">
<div class="square-box pull-left">
<span class="fa fa-user"></span>
</div>
<h5 class="text-success">Company Name</h5>
<h4>Name: <b>Full name</b></h4>
<p>Title: Manager</p>
<span>Email: [email protected]</span>
</div>
</div>
<div class="items col-xs-12 col-sm-12 col-md-6 col-lg-6">
<div class="info-block block-info clearfix">
<div class="square-box pull-left">
<span class="fa fa-user"></span>
</div>
<h5 class="text-success">Company Name</h5>
<h4>Name: <b>Full name</b></h4>
<p>Title: Manager</p>
<span>Email: [email protected]</span>
</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 :
.title{
margin-left:20px
}
.fa-user{
font-size:80px
}
.searchable-container{
margin-top:40px;
}
.glyphicon-lg{
font-size:4em
}
.info-block{
border-right:5px solid #E6E6E6;margin-bottom:25px
}
.info-block .square-box {
width:120px;
min-height:120px;
margin-right:22px;
text-align:center!important;
background-color:#676767;
padding:20px 0
}
.info-block:hover .info-block.block-info {
border-color:#20819e
}
.info-block.block-info .square-box {
background-color:#5bc0de;
color:#FFF
}