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 bootstrap snippets bootdey">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-md-offset-2">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">
<span class="glyphicon glyphicon-th"></span>
Change password
</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6 separator social-login-box"> <br/>
<img alt="" class="img-thumbnail" src="https://bootdey.com/img/Content/avatar/avatar1.png"/>
</div>
<div style={{/*margin-top:80px;*/}} class="col-xs-6 col-sm-6 col-md-6 login-box">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div>
<input class="form-control" type="password" placeholder="Current Password"/>
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-log-in"></span></div>
<input class="form-control" type="password" placeholder="New Password"/>
</div>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6"></div>
<div class="col-xs-6 col-sm-6 col-md-6">
<button class="btn icon-btn-save btn-success" type="submit">
<span class="btn-save-label"><i class="glyphicon glyphicon-floppy-disk"></i></span>save</button>
</div>
</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{
background:#eee;
}
.separator {
border-right: 1px solid #dfdfe0;
}
.icon-btn-save {
padding-top: 0;
padding-bottom: 0;
}
.input-group {
margin-bottom:10px;
}
.btn-save-label {
position: relative;
left: -12px;
display: inline-block;
padding: 6px 12px;
background: rgba(0,0,0,0.15);
border-radius: 3px 0 0 3px;
}