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://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="container bootstrap snippets bootdey">
<div class="row">
<div class="col-md-4">
<div class="g-hover-card">
<img src="https://www.bootdey.com/image/400x200/" alt=""/>
<div class="user-avatar">
<img src="https://bootdey.com/img/Content/user_6.jpg" alt=""/>
</div>
<div class="info">
<div class="title">
<a href="https://bootdey.com/profile/Dey-Dey">bootdey.com/profile/Dey-Dey</a>
</div>
<div class="description">Dey-Dey</div>
</div>
<div class="bottom">
<a href="https://twitter.com/bootdey" class="btn btn-info btn-xs">
<i class="fa fa-twitter"></i>
Twitter
</a>
<a href="https://facebook.com/bootdey" class="btn btn-primary btn-xs">
<i class="fa fa-facebook"></i>
Facebook
</a>
<a href="https://plus.google.com/+Bootdey-bootstrap/posts" class="btn btn-danger btn-xs">
<i class="fa fa-google-plus"></i>
Google +
</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="g-hover-card">
<img src="https://www.bootdey.com/image/400x200/" alt=""/>
<div class="user-avatar">
<img src="https://bootdey.com/img/Content/user_1.jpg" alt=""/>
</div>
<div class="info">
<div class="title">
<a href="https://bootdey.com/">bootdey.com</a>
</div>
<div class="description">Mark</div>
</div>
<div class="bottom">
<a href="https://twitter.com/bootdey" class="btn btn-info btn-xs">
<i class="fa fa-twitter"></i>
Twitter
</a>
<a href="https://facebook.com/bootdey" class="btn btn-primary btn-xs">
<i class="fa fa-facebook"></i>
Facebook
</a>
<a href="https://plus.google.com/+Bootdey-bootstrap/posts" class="btn btn-danger btn-xs">
<i class="fa fa-google-plus"></i>
Google +
</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="g-hover-card">
<img src="https://www.bootdey.com/image/400x200/" alt=""/>
<div class="user-avatar">
<img src="https://bootdey.com/img/Content/user_3.jpg" alt=""/>
</div>
<div class="info">
<div class="title">
<a href="https://bootdey.com/">bootdey.com</a>
</div>
<div class="description">Mario</div>
</div>
<div class="bottom">
<a href="https://twitter.com/bootdey" class="btn btn-info btn-xs">
<i class="fa fa-twitter"></i>
Twitter
</a>
<a href="https://facebook.com/bootdey" class="btn btn-primary btn-xs">
<i class="fa fa-facebook"></i>
Facebook
</a>
<a href="https://plus.google.com/+Bootdey-bootstrap/posts" class="btn btn-danger btn-xs">
<i class="fa fa-google-plus"></i>
Google +
</a>
</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: #ddd;
margin-top:20px;
}
.g-hover-card {
position: relative;
text-align: center;
background-color: #fff;
}
.g-hover-card img {
width: 280px;
height: 135px;
}
.g-hover-card .user-avatar {
position: relative;
top: -40px;
margin-bottom: -40px;
}
.g-hover-card .user-avatar img {
width: 80px;
height: 80px;
max-width: 80px;
max-height: 80px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
}
.g-hover-card .info {
padding: 4px 8px 10px;
}
.g-hover-card .info.title {
margin-bottom: 4px;
font-size: 24px;
line-height: 1;
color: #262626;
vertical-align: middle;
}
.g-hover-card .info.descriptions {
overflow: hidden;
font-size: 12px;
line-height: 20px;
color: #737373;
text-overflow: ellipsis;
}
.g-hover-card .bottom {
padding: 0 20px;
margin-bottom: 17px;
}
.g-hover-card{
width: 280px;
padding-top: 0;
overflow: hidden;
}