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">
<div class="col-lg-2 col-sm-6">
<div class="circle-tile ">
<a href="#/"><div class="circle-tile-heading dark-blue"><i class="fa fa-users fa-fw fa-3x"></i></div></a>
<div class="circle-tile-content dark-blue">
<div class="circle-tile-description text-faded"> Users</div>
<div class="circle-tile-number text-faded ">265</div>
<a class="circle-tile-footer" href="#/">More Info<i class="fa fa-chevron-circle-right"></i></a>
</div>
</div>
</div>
<div class="col-lg-2 col-sm-6">
<div class="circle-tile ">
<a href="#/"><div class="circle-tile-heading red"><i class="fa fa-users fa-fw fa-3x"></i></div></a>
<div class="circle-tile-content red">
<div class="circle-tile-description text-faded"> Users Online </div>
<div class="circle-tile-number text-faded ">10</div>
<a class="circle-tile-footer" href="#/">More Info<i class="fa fa-chevron-circle-right"></i></a>
</div>
</div>
</div>
<div class="col-lg-2 col-sm-6">
<div class="circle-tile ">
<a href="#/"><div class="circle-tile-heading yellow "><i class="fa fa-envelope fa-fw fa-3x"></i></div></a>
<div class="circle-tile-content yellow">
<div class="circle-tile-description text-faded"> Emails </div>
<div class="circle-tile-number text-faded ">10</div>
<a class="circle-tile-footer" href="#/">More Info<i class="fa fa-chevron-circle-right"></i></a>
</div>
</div>
</div>
<div class="col-lg-2 col-sm-6">
<div class="circle-tile ">
<a href="#/"><div class="circle-tile-heading orange"><i class="fa fa-comments fa-fw fa-3x"></i></div></a>
<div class="circle-tile-content orange">
<div class="circle-tile-description text-faded"> Messages </div>
<div class="circle-tile-number text-faded ">10</div>
<a class="circle-tile-footer" href="#/">More Info<i class="fa fa-chevron-circle-right"></i></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 :
.circle-tile {
margin-bottom: 15px;
text-align: center;
}
.circle-tile-heading {
border: 3px solid rgba(255, 255, 255, 0.3);
border-radius: 100%;
color: #FFFFFF;
height: 80px;
margin: 0 auto -40px;
position: relative;
transition: all 0.3s ease-in-out 0s;
width: 80px;
}
.circle-tile-heading .fa {
line-height: 80px;
}
.circle-tile-content {
padding-top: 50px;
}
.circle-tile-number {
font-size: 26px;
font-weight: 700;
line-height: 1;
padding: 5px 0 15px;
}
.circle-tile-description {
text-transform: uppercase;
}
.circle-tile-footer {
background-color: rgba(0, 0, 0, 0.1);
color: rgba(255, 255, 255, 0.5);
display: block;
padding: 5px;
transition: all 0.3s ease-in-out 0s;
}
.circle-tile-footer:hover {
background-color: rgba(0, 0, 0, 0.2);
color: rgba(255, 255, 255, 0.5);
text-decoration: none;
}
.circle-tile-heading.dark-blue:hover {
background-color: #2E4154;
}
.circle-tile-heading.green:hover {
background-color: #138F77;
}
.circle-tile-heading.orange:hover {
background-color: #DA8C10;
}
.circle-tile-heading.blue:hover {
background-color: #2473A6;
}
.circle-tile-heading.red:hover {
background-color: #CF4435;
}
.circle-tile-heading.purple:hover {
background-color: #7F3D9B;
}
.tile-img {
text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.9);
}
.dark-blue {
background-color: #34495E;
}
.green {
background-color: #16A085;
}
.blue {
background-color: #2980B9;
}
.orange {
background-color: #F39C12;
}
.red {
background-color: #E74C3C;
}
.purple {
background-color: #8E44AD;
}
.dark-gray {
background-color: #7F8C8D;
}
.gray {
background-color: #95A5A6;
}
.light-gray {
background-color: #BDC3C7;
}
.yellow {
background-color: #F1C40F;
}
.text-dark-blue {
color: #34495E;
}
.text-green {
color: #16A085;
}
.text-blue {
color: #2980B9;
}
.text-orange {
color: #F39C12;
}
.text-red {
color: #E74C3C;
}
.text-purple {
color: #8E44AD;
}
.text-faded {
color: rgba(255, 255, 255, 0.7);
}