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">
<div class="row">
<div class="col-md-6 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading"><a class="pull-right" href="#/">View all</a> <h4>Upgrade to Bootstrap 3</h4></div>
<div class="panel-body">
<img class="img-circle pull-right img-thumbnail" width="80" height="80" src="https://bootdey.com/img/Content/avatar/avatar6.png"/> <a href="#/">Guidance and Tools</a>
<div class="clearfix"></div>
<hr/>
<p>Migrating from Bootstrap 2.x to 3 is not a simple matter of swapping out the JS and CSS files.
Bootstrap 3 is a major overhaul, and there are a lot of changes from Bootstrap 2.x. <a href="https://bootdey.com">This guidance</a> is intended to help 2.x developers transition to 3.
</p>
<h5><a href="https://bootdey.com">More snippets on Bootdey</a></h5>
</div>
</div>
</div>
<div class="col-md-6 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading"><a class="pull-right" href="#/">View all</a> <h4>Upgrade to Bootstrap 3</h4></div>
<div class="panel-body">
<img class="img-circle pull-right img-thumbnail" width="80" height="80" src="https://bootdey.com/img/Content/avatar/avatar7.png"/> <a href="#/">Guidance and Tools</a>
<div class="clearfix"></div>
<hr/>
<p>Migrating from Bootstrap 2.x to 3 is not a simple matter of swapping out the JS and CSS files.
Bootstrap 3 is a major overhaul, and there are a lot of changes from Bootstrap 2.x. <a href="https://bootdey.com">This guidance</a> is intended to help 2.x developers transition to 3.
</p>
<h5><a href="https://bootdey.com">More snippets on Bootdey</a></h5>
</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 :
body{
background:#eee;
}
.panel .panel-heading {
background-color: #FFFFFF;
border-color: #FFFFFF;
color: #262626;
font-size: 16px;
font-weight: 700;
}
.panel .panel-heading a {
font-size: 11px;
font-weight: 400;
}