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="col-md-4 col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Notifications</h3>
</div>
<div class="panel-body">
<div class="alert alert-success">
<strong class="default"><i class="fa fa-road"></i> Well done,</strong> You have finished job!
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
<div class="alert alert-info">
<strong class="default"><i class="fa fa-user"></i> John</strong> sent you friend request.
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
<div class="alert alert-warning">
<strong class="default"><i class="fa fa-envelope-o"></i> Sam</strong> sent important mail.
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
<div class="alert alert-danger">
<strong class="default"><i class="fa fa-hdd-o"></i> Server </strong> reported problems.
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
<div class="alert alert-info nomargin">
<strong class="default"><i class="fa fa-money"></i> Received </strong> $1826 from client.
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-lg-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Notifications</h3>
</div>
<div class="panel-body">
<div class="alert alert-info">
<strong class="default"><i class="fa fa-road"></i> Well done,</strong> You have finished job!
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
<div class="alert alert-success">
<strong class="default"><i class="fa fa-user"></i> John</strong> sent you friend request.
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
<div class="alert alert-danger">
<strong class="default"><i class="fa fa-envelope-o"></i> Sam</strong> sent important mail.
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
<div class="alert alert-warning">
<strong class="default"><i class="fa fa-hdd-o"></i> Server </strong> reported problems.
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
<div class="alert alert-info nomargin">
<strong class="default"><i class="fa fa-money"></i> Received </strong> $1826 from client.
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</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;}
.panel-default > .panel-heading {
color: #333;
background-color: #fcfcfc;
border-color: #ddd;
border-color: rgba(221,221,221,0.85);
}