A React HOC module which can be used to create Facebook like loading elelements before data is fetched.
npm i react-fblike-loader --save
import {ReactCardLoader} from 'react-fblike-loader'
<ReactCardLoader>
your html goes here....
</ReactCardLoader>
<div>
<h5 className="ph">some text</h5>
<p className="ph">some text</h5>
<a className="ph" href="#">some text</h5>
</div>
P.S: Any elements which needs to be shown loader should have the class ph
<div className="image-wrapper">
<img className="ph" src={image_souce} alt="dummy image"/>
</div>
import React from 'react';
import './App.css';
import {ReactCardLoader} from 'react-fblike-loader'
function App() {
return (
<div className="App">
<ReactCardLoader isLoading={false}> // instead of false you can use state variable to check whether data has been fetched or not
your html goes here....
</ReactCardLoader>
</div>
);
}
export default App;
Name | PropType | Value | Default |
---|---|---|---|
isLoading | Boolean | true / false | false |
If you like my work and if my product has helped you in your development please feel free to give a shoutout: