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="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="container bootstrap snippets bootdey">
<div class="col-md-12">
<h2 class="text-primary">
<i class="fa fa-tachometer"></i>
Home menu
</h2>
<hr/>
<div class="row">
<div class="col-md-3">
<div class="panel panel-info ">
<div class="panel-heading">
<div class="row">
<div class="col-xs-6">
<i class="fa fa-calculator fa-5x"></i>
</div>
<div class="col-xs-6 text-right">
<p class="announcement-heading"> </p>
<p class="announcement-text">Math</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-md-3">
<div class="panel panel-success ">
<div class="panel-heading">
<div class="row">
<div class="col-xs-6">
<i class="fa fa-leanpub fa-5x"></i>
</div>
<div class="col-xs-6 text-right">
<p class="announcement-heading"> </p>
<p class="announcement-text">Language</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-md-3">
<div class="panel panel-warning ">
<div class="panel-heading">
<div class="row">
<div class="col-xs-6">
<i class="fa fa-flask fa-5x"></i>
</div>
<div class="col-xs-6 text-right">
<p class="announcement-heading"> </p>
<p class="announcement-text">Science</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-md-3">
<div class="panel panel-danger ">
<div class="panel-heading">
<div class="row">
<div class="col-xs-6">
<i class="fa fa-video-camera fa-5x"></i>
</div>
<div class="col-xs-6 text-right">
<p class="announcement-heading"> </p>
<p class="announcement-text">Video</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>
<div class="col-md-12">
<div class="container bootstrap snippets bootdey">
<footer class="footer">
<hr/>
<p>© Company name 2015</p>
</footer>
</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;}