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="col-md-4 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading"><a class="pull-right" href="#/">View all</a> <h4>Profiles</h4></div>
<div class="panel-body">
Check out some of our member profiles..
<hr/>
<div class="well well-sm">
<div class="media">
<a href="#/" class="thumbnail pull-left">
<img src="//placehold.it/80" class="media-object"/>
</a>
<div class="media-body">
<h4 class="media-heading">John Doe</h4>
<p><span class="label label-info">10 photos</span> <span class="label label-primary">89 followers</span></p>
<p>
<a class="btn btn-xs btn-default" href="#/"><span class="glyphicon glyphicon-comment"></span> Message</a>
<a class="btn btn-xs btn-default" href="#/"><span class="glyphicon glyphicon-heart"></span> Favorite</a>
</p>
</div>
</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{margin-top:20px;}