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="col-md-6">
<div class="widget widget-gallery">
<div class="widget-gallery-header">
<h5>Latest Uploaded Image</h5>
<p class="text-muted m-t-3">
last updated on 29 November 2015
</p>
</div>
<ul class="widget-gallery-list clearfix">
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
</ul>
</div>
</div>
<div class="col-md-6">
<div class="widget widget-gallery">
<div class="widget-gallery-header">
<h5>Latest Uploaded Image</h5>
<p class="text-muted m-t-3">
last updated on 29 November 2015
</p>
</div>
<ul class="widget-gallery-list clearfix">
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
</ul>
</div>
</div>
<div class="col-md-6">
<div class="widget widget-gallery">
<div class="widget-gallery-header">
<h5>Latest Uploaded Image</h5>
<p class="text-muted m-t-3">
last updated on 29 November 2015
</p>
</div>
<ul class="widget-gallery-list clearfix">
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
</ul>
</div>
</div>
<div class="col-md-6">
<div class="widget widget-gallery">
<div class="widget-gallery-header">
<h5>Latest Uploaded Image</h5>
<p class="text-muted m-t-3">
last updated on 29 November 2015
</p>
</div>
<ul class="widget-gallery-list clearfix">
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
<li><a href="#/"><img src="https://www.bootdey.com/image/400x200/" alt=""/></a></li>
</ul>
</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;
margin-top:20px;
}
.widget {
border: none;
box-shadow: 0 2px 0 rgba(0,0,0,.07);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
margin-bottom: 20px;
position: relative;
background: #fff;
padding: 20px;
display: block;
}
.widget-gallery-header {
margin: -20px -20px 0;
padding: 20px;
border-radius: 5px 5px 0 0;
}
.widget-gallery-list {
list-style-type: none;
margin: -5px -20px -20px;
padding: 3px 0 0 3px;
}
.widget-gallery-list>li {
width: 25%;
position: relative;
padding-top: 25%;
overflow: hidden;
float: left;
}
.widget-gallery-list>li a {
background: #EAEDEF;
color: #aab3ba;
text-decoration: none;
}
.widget-gallery-list>li img {
position: absolute;
right: 3px;
bottom: 3px;
max-height: 100%;
}
.widget-gallery-header p {
font-size: 12px;
}
.widget-gallery-header h5, .widget-gallery-header p {
margin: 0;
}
.text-muted {
color: #aab3ba;
}
.m-t-3 {
margin-top: 3px!important;
}
.widget-gallery-list>li a:before {
content: '';
position: absolute;
top: 50%;
right: 50%;
bottom: 50%;
left: 50%;
transition: all .2s ease-in-out;
background: 0 0;
z-index: 1020;
border-radius: 50%;
}
.widget-gallery-list>li:hover a:before {
content: '';
left: 0;
right: 3px;
top: 0;
bottom: 3px;
background: rgba(0,0,0,.3);
border-radius: 0;
}