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 col-sm-4 col-xs-12">
<div class="panel panel-primary text-center">
<div class="panel-body">
<img class="img-responsive img-effect" src="https://www.bootdey.com/image/700x500/FFB6C1/000000"/>
</div>
<div class="panel-footer">
<span class="label label-primary">Product name</span>
<span class="pull-right">
<a href="#/" class="btn btn-primary btn-xs tip" title="Favorite">
<i class="glyphicon glyphicon-heart"></i>
</a>
<a href="#/" class="btn btn-primary btn-xs tip" title="Buy">
<i class="glyphicon glyphicon-shopping-cart"></i>
</a>
<a href="#/" class="btn btn-primary btn-xs tip" title="Share">
<i class="glyphicon glyphicon-share"></i>
</a>
</span>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="panel panel-success">
<div class="panel-body">
<img class="img-responsive img-effect" src="https://www.bootdey.com/image/700x500/9400D3/000000"/>
</div>
<div class="panel-footer">
<span class="label label-success">Product name</span>
<span class="pull-right">
<a href="#/" class="btn btn-success btn-xs tip" title="Favorite">
<i class="glyphicon glyphicon-heart"></i>
</a>
<a href="#/" class="btn btn-success btn-xs tip" title="Buy">
<i class="glyphicon glyphicon-shopping-cart"></i>
</a>
<a href="#/" class="btn btn-success btn-xs tip" title="Share">
<i class="glyphicon glyphicon-share"></i>
</a>
</span>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="panel panel-danger">
<div class="panel-body">
<img class="img-responsive img-effect" src="https://www.bootdey.com/image/700x500/00BFFF/000000"/>
</div>
<div class="panel-footer">
<span class="label label-danger">Product name</span>
<span class="pull-right">
<a href="#/" class="btn btn-danger btn-xs tip" title="Favorite">
<i class="glyphicon glyphicon-heart"></i>
</a>
<a href="#/" class="btn btn-danger btn-xs tip" title="Buy">
<i class="glyphicon glyphicon-shopping-cart"></i>
</a>
<a href="#/" class="btn btn-danger btn-xs tip" title="Share">
<i class="glyphicon glyphicon-share"></i>
</a>
</span>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="panel panel-info">
<div class="panel-body">
<img class="img-responsive img-effect" src="https://www.bootdey.com/image/700x500/4B0082/000000"/>
</div>
<div class="panel-footer">
<span class="label label-info">Product name</span>
<span class="pull-right">
<a href="#/" class="btn btn-info btn-xs tip" title="Favorite">
<i class="glyphicon glyphicon-heart"></i>
</a>
<a href="#/" class="btn btn-info btn-xs tip" title="Buy">
<i class="glyphicon glyphicon-shopping-cart"></i>
</a>
<a href="#/" class="btn btn-info btn-xs tip" title="Share">
<i class="glyphicon glyphicon-share"></i>
</a>
</span>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="panel panel-warning">
<div class="panel-body">
<img class="img-responsive img-effect" src="https://www.bootdey.com/image/700x500/20B2AA/000000"/>
</div>
<div class="panel-footer">
<span class="label label-warning">Product name</span>
<span class="pull-right">
<a href="#/" class="btn btn-warning btn-xs tip" title="Favorite">
<i class="glyphicon glyphicon-heart"></i>
</a>
<a href="#/" class="btn btn-warning btn-xs tip" title="Buy">
<i class="glyphicon glyphicon-shopping-cart"></i>
</a>
<a href="#/" class="btn btn-warning btn-xs tip" title="Share">
<i class="glyphicon glyphicon-share"></i>
</a>
</span>
</div>
</div>
</div>
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="panel panel-default">
<div class="panel-body">
<img class="img-responsive img-effect" src="https://www.bootdey.com/image/700x500/87CEFA/000000"/>
</div>
<div class="panel-footer">
<span class="label label-default">Product name</span>
<span class="pull-right">
<a href="#/" class="btn btn-default btn-xs tip" title="Favorite">
<i class="glyphicon glyphicon-heart"></i>
</a>
<a href="#/" class="btn btn-default btn-xs tip" title="Buy">
<i class="glyphicon glyphicon-shopping-cart"></i>
</a>
<a href="#/" class="btn btn-default btn-xs tip" title="Share">
<i class="glyphicon glyphicon-share"></i>
</a>
</span>
</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{margin-top:20px;}
.img-effect:hover {
opacity:0.9;
cursor: pointer;
border-radius: 0px;
-webkit-transform: scale(1.2, 1.2);
-webkit-transition-timing-function: ease-out;
-moz-transform: scale(1.2, 1.2);
-moz-transition-timing-function: ease-out;
-ms-transform: scale(1.20, 1.20);
-ms-transition-timing-function: ease-out;
-webkit-transition-duration: 500ms;
-moz-transition-duration: 500ms;
-ms-transition-duration: 500ms;
}