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 id="page-wrapper" class="container">
<div class="row">
<div class="col-lg-12">
<h1>Dashboard <small>Statistics Overview</small></h1>
<ol class="breadcrumb">
<li class="active"><i class="fa fa-dashboard"></i> Dashboard</li>
</ol>
<div class="alert alert-success alert-dismissable">
<button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
Use this boxes to fill your dashboard. You can load number of users, activities, logs, etc...
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3">
<div class="panel panel-info">
<div class="panel-heading">
<div class="row">
<div class="col-xs-6">
<i class="fa fa-users fa-5x"></i>
</div>
<div class="col-xs-6 text-right">
<p class="announcement-heading">1</p>
<p class="announcement-text">Users</p>
</div>
</div>
</div>
<a href="#/">
<div class="panel-footer announcement-bottom">
<div class="row">
<div class="col-xs-6">
View
</div>
<div class="col-xs-6 text-right">
<i class="fa fa-arrow-circle-right"></i>
</div>
</div>
</div>
</a>
</div>
</div>
<div class="col-lg-3">
<div class="panel panel-warning">
<div class="panel-heading">
<div class="row">
<div class="col-xs-6">
<i class="fa fa-check fa-5x"></i>
</div>
<div class="col-xs-6 text-right">
<p class="announcement-heading">12</p>
<p class="announcement-text">To-Do Items</p>
</div>
</div>
</div>
<a href="#/">
<div class="panel-footer announcement-bottom">
<div class="row">
<div class="col-xs-6">
View
</div>
<div class="col-xs-6 text-right">
<i class="fa fa-arrow-circle-right"></i>
</div>
</div>
</div>
</a>
</div>
</div>
<div class="col-lg-3">
<div class="panel panel-danger">
<div class="panel-heading">
<div class="row">
<div class="col-xs-6">
<i class="fa fa-tasks fa-5x"></i>
</div>
<div class="col-xs-6 text-right">
<p class="announcement-heading">18</p>
<p class="announcement-text">Crawl Errors</p>
</div>
</div>
</div>
<a href="#/">
<div class="panel-footer announcement-bottom">
<div class="row">
<div class="col-xs-6">
View
</div>
<div class="col-xs-6 text-right">
<i class="fa fa-arrow-circle-right"></i>
</div>
</div>
</div>
</a>
</div>
</div>
<div class="col-lg-3">
<div class="panel panel-success">
<div class="panel-heading">
<div class="row">
<div class="col-xs-6">
<i class="fa fa-comments fa-5x"></i>
</div>
<div class="col-xs-6 text-right">
<p class="announcement-heading">56</p>
<p class="announcement-text">New Orders!</p>
</div>
</div>
</div>
<a href="#/">
<div class="panel-footer announcement-bottom">
<div class="row">
<div class="col-xs-6">
View
</div>
<div class="col-xs-6 text-right">
<i class="fa fa-arrow-circle-right"></i>
</div>
</div>
</div>
</a>
</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;
background:#eee;
}
#page-wrapper {
padding: 15px 25px;
}