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-md-4">
<a class="cta text-center" href="#/">
<h2 class="name">Adam moort</h2>
<img alt="" class="img-responsive" src="https://bootdey.com/img/Content/avatar/avatar6.png"/>
<h2>Designer</h2>
<p>Run forest run</p>
</a>
</div>
<div class="col-md-4">
<a class="cta text-center" href="#/">
<h2 class="name">Jef fernadis</h2>
<img alt="" class="img-responsive" src="https://bootdey.com/img/Content/avatar/avatar7.png"/>
<h2>Developer</h2>
<p>oooooohhhhhh!</p>
</a>
</div>
<div class="col-md-4">
<a class="cta text-center" href="#/">
<h2 class="name">Martin Breton</h2>
<img alt="" class="img-thumbnail img-responsive" src="https://bootdey.com/img/Content/avatar/avatar1.png"/>
<h2>Tester</h2>
<p>Adventure time</p>
</a>
</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:40px;
}
.cta {
display: block;
padding: 30px;
border: 3px dotted #eee;
border-radius: 4px;
margin: 0 3%;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.12);
}
.cta .name {
opacity: 0.2;
}
.cta img {
padding: 4px;
line-height: 1.42857143;
background-color: #fff;
border: 1px dashed #ddd;
border-radius: 4px;
-webkit-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
-webkit-transform: rotate(-10deg);
-moz-transform: rotate(-10deg);
-o-transform: rotate(-10deg);
-ms-transform: rotate(-10deg);
transform: rotate(-10deg);
}
a:hover{
text-decoration:none;
}