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-3">
<div class="tile-progress tile-primary">
<div class="tile-header">
<h3>Visitors</h3>
<span>so far in our blog, and our website.</span>
</div>
<div class="tile-progressbar">
<span data-fill="65.5%" style={{/*width: 65.5%;*/}}></span>
</div>
<div class="tile-footer">
<h4>
<span class="pct-counter">65.5</span>% increase
</h4>
<span>so far in our blog and our website</span>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="tile-progress tile-red">
<div class="tile-header">
<h3>Visitors</h3>
<span>so far in our blog, and our website.</span>
</div>
<div class="tile-progressbar">
<span data-fill="23.2%" style={{/*width: 23.2%;*/}}></span>
</div>
<div class="tile-footer">
<h4>
<span class="pct-counter">23.2</span>% increase
</h4>
<span>so far in our blog and our website</span>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="tile-progress tile-blue">
<div class="tile-header">
<h3>Visitors</h3>
<span>so far in our blog, and our website.</span>
</div>
<div class="tile-progressbar">
<span data-fill="78%" style={{/*width: 78%;*/}}></span>
</div>
<div class="tile-footer">
<h4>
<span class="pct-counter">78</span>% increase
</h4>
<span>so far in our blog and our website</span>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="tile-progress tile-aqua">
<div class="tile-header">
<h3>Visitors</h3>
<span>so far in our blog, and our website.</span>
</div>
<div class="tile-progressbar">
<span data-fill="22%" style={{/*width: 22%;*/}}></span>
</div>
<div class="tile-footer">
<h4>
<span class="pct-counter">22</span>% increase
</h4>
<span>so far in our blog and our website</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<div class="tile-progress tile-green">
<div class="tile-header">
<h3>Visitors</h3>
<span>so far in our blog, and our website.</span>
</div>
<div class="tile-progressbar">
<span data-fill="94%" style={{/*width: 94%;*/}}></span>
</div>
<div class="tile-footer">
<h4>
<span class="pct-counter">94</span>% increase
</h4>
<span>so far in our blog and our website</span>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="tile-progress tile-cyan">
<div class="tile-header">
<h3>Visitors</h3>
<span>so far in our blog, and our website.</span>
</div>
<div class="tile-progressbar">
<span data-fill="45.9%" style={{/*width: 45.9%;*/}}></span>
</div>
<div class="tile-footer">
<h4>
<span class="pct-counter">45.9</span>% increase
</h4>
<span>so far in our blog and our website</span>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="tile-progress tile-purple">
<div class="tile-header">
<h3>Visitors</h3>
<span>so far in our blog, and our website.</span>
</div>
<div class="tile-progressbar">
<span data-fill="27%" style={{/*width: 27%;*/}}></span>
</div>
<div class="tile-footer">
<h4>
<span class="pct-counter">27</span>% increase
</h4>
<span>so far in our blog and our website</span>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="tile-progress tile-pink">
<div class="tile-header">
<h3>Visitors</h3>
<span>so far in our blog, and our website.</span>
</div>
<div class="tile-progressbar">
<span data-fill="3" style={{/*width: 3%;*/}}></span>
</div>
<div class="tile-footer">
<h4>
<span class="pct-counter">3</span>% increase
</h4>
<span>so far in our blog and our website</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 :
.tile-progress {
background-color: #303641;
color: #fff;
}
.tile-progress {
background: #00a65b;
color: #fff;
margin-bottom: 20px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.tile-progress .tile-header {
padding: 15px 20px;
padding-bottom: 40px;
}
.tile-progress .tile-progressbar {
height: 2px;
background: rgba(0,0,0,0.18);
margin: 0;
}
.tile-progress .tile-progressbar span {
background: #fff;
}
.tile-progress .tile-progressbar span {
display: block;
background: #fff;
width: 0;
height: 100%;
-webkit-transition: all 1.5s cubic-bezier(0.230,1.000,0.320,1.000);
-moz-transition: all 1.5s cubic-bezier(0.230,1.000,0.320,1.000);
-o-transition: all 1.5s cubic-bezier(0.230,1.000,0.320,1.000);
transition: all 1.5s cubic-bezier(0.230,1.000,0.320,1.000);
}
.tile-progress .tile-footer {
padding: 20px;
text-align: right;
background: rgba(0,0,0,0.1);
-webkit-border-radius: 0 0 3px 3px;
-webkit-background-clip: padding-box;
-moz-border-radius: 0 0 3px 3px;
-moz-background-clip: padding;
border-radius: 0 0 3px 3px;
background-clip: padding-box;
-webkit-border-radius: 0 0 3px 3px;
-moz-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
}
.tile-progress.tile-red {
background-color: #f56954;
color: #fff;
}
.tile-progress {
background-color: #303641;
color: #fff;
}
.tile-progress.tile-blue {
background-color: #0073b7;
color: #fff;
}
.tile-progress.tile-aqua {
background-color: #00c0ef;
color: #fff;
}
.tile-progress.tile-green {
background-color: #00a65a;
color: #fff;
}
.tile-progress.tile-cyan {
background-color: #00b29e;
color: #fff;
}
.tile-progress.tile-purple {
background-color: #ba79cb;
color: #fff;
}
.tile-progress.tile-pink {
background-color: #ec3b83;
color: #fff;
}