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="col-md-8">
<div class="panel panel-default">
<div class="panel-heading"><a class="pull-right" href="#/">View all</a> <h4>main articles</h4></div>
<div class="panel-body">
<img class="img-circle pull-right" src="https://www.bootdey.com/image/120x90/008000/000000"/> <a href="#/">Articles</a>
<div class="clearfix"></div>
<hr/>
<div class="clearfix"></div>
<img class="img-responsive img-thumbnail pull-right" src="https://www.bootdey.com/image/120x90/00BFFF/000000"/>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
<div class="clearfix"></div>
<hr/>
<div class="clearfix"></div>
<img style={{/*margin-right:5px;*/}} class="img-responsive img-thumbnail pull-left" src="https://www.bootdey.com/image/120x90/FF1493/000000"/>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
</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 :
.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;
}