A simple loading overlay with spinner and transitions for React applications.
Install using npm
npm install react-loader-overlay --save
or
yarn add react-loader-overlay --save
-
Import
Loader
fromreact-loader-overlay
-
Use
Loader
like a React component. When theactive
prop passed toLoader
istrue
, a translucent overlay is shown over the entire page, with a spinner in the center.
import React, { useState } from "react";
import { Loader } from "react-loader-overlay";
function App() {
const [loading, setLoading] = useState(false)
return (
<div className="App">
<header className="App-header">
<Loader active={loading}/>
<p>
Welcome! <code>React Pre Loader with Overlay</code>.
</p>
</header>
</div>
);
}
export default App;
active
(boolean)- default:
true
- whether the loader is visible.
- default:
If you discover a security vulnerability or bugs within React Overlay Preloader, please send an e-mail to Muhaimenul Islam via [email protected].
The React Overlay Preloader package is open-sourced project licensed under the MIT license.