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="row">
<div class="col-md-4 col-md-offset-4">
<div class="text-center">
<img src="https://bootdey.com/img/Content/avatar/avatar1.png" width="180" class="img-thumbnail logo img-circle"/>
<div>
<h3 class="text-center">Forgot password?</h3>
</div>
<div class="panel-body">
<div class="alert alert-danger">
<a class="close" data-dismiss="alert" href="#/">×</a>Incorrect Email Address!
</div>
<fieldset>
<div class="form-group">
<input class="form-control input-lg" placeholder="E-mail Address" name="email" type="text"/>
</div>
<input class="btn btn-lg btn-primary btn-block" value="SEND ME PASSWORD" type="submit"/>
</fieldset>
</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;
}
.img-thumbnail{
border:0px;
}
.btn, .input-lg, .alert {border-radius:2px !important;}