React-Overlay-Loading
Installation
npm install overlay-loading-react
Quick start:
import OverlayLoader from "overlay-loading-react";
<OverlayLoader loadingText='Loading...' active />
Variants
Custom Loader:
Custom loader can be used in form of GIF and React Elements as well.
import OverlayLoader from "./components/Loader";
const App = () => {
return (
<OverlayLoader>
<MyComponent /> // Your Loader
</OverlayLoader>
);
}
Props:
-
active
(boolean)- default:
true
- default:
-
onClick
(function)- default:
undefined
- click handler for the overlay when active.
- default:
-
overlayContainerStyle
(object)- default:
{}
- inline styling for overlay main container.
- default:
-
contentContainerStyle
(object)- default:
{}
- inline styling for content container.
- default:
-
loadingTextStyle
(object)- default:
{}
- inline styling for loading text if provided.
- default:
-
loadingText
(string)- default:
undefined
- the text to render in the loader overlay when active.
- default:
-
variant
(string)- default:
spinner
- The type of loading to show.
- default: