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://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"/>
<div class="container bootstrap snippets bootdey">
<div class="header">
<h3 class="text-muted prj-name">
<span class="fa fa-users fa-2x"></span>
Users
</h3>
</div>
<div class="jumbotron" style={{/*min-height:400px;height:auto;*/}}>
<ul class="list-group">
<li class="list-group-item user-item text-left">
<img class="img-circle img-user img-thumbnail " src="https://bootdey.com/img/Content/avatar/avatar7.png"/>
<h3>
<a href="#/">Bootdey bootstrap</a><br/>
</h3>
</li>
<li class="list-group-item user-item text-left">
<img class="img-circle img-user img-thumbnail" src="https://bootdey.com/img/Content/avatar/avatar1.png"/>
<h3>
<a href="#/">Mark martin lowkeymth</a><br/>
</h3>
</li>
<li class="list-group-item user-item text-left">
<img class="img-circle img-user img-thumbnail" src="https://bootdey.com/img/Content/avatar/avatar6.png"/>
<h3>
<a href="#/">John Doe</a><br/>
</h3>
</li>
</ul>
</div>
</div>
</div>
);
}
export default App;
4. Now we need to add below code into our my-awesome-project/src/App.css file :
.jumbotron .btn {
color:#FFFFFF;
padding: 5px !important;
font-size: 12px !important;
margin-left:20px;
}
.jumbotron label {
font-size:12px;
}
.img-user{
height:120px;
width:120px;
margin-right:20px;
}
.prj-name{
font-weight:bold;
color:#5bc0de;
}
.user-item img, .user-item h3 {
display:inline-block;
}
.jumbotron .btn .user-item h3 a{
color:#5bc0de;
padding: 5px !important;
font-size: 12px !important;
}