react-flexy-loader
most easy to use react loader
install
npm install react-flexy-loader
live demo
https://react-flexy-loader.netlify.app/
usage
import react-flexy-loader and add show props
const App = { return <ReactFlexyLoader show />}
if you want to change alpha value just pass it
const App = { return <ReactFlexyLoader show alpha=04 />}
If you have a spinner just pass it as a child. If you do that default spinner will be removed and new spinner replace it. For example if you want to use bootstrap spinner just pass it and spinner will be changed.
const App = { return <ReactFlexyLoader show> <Spinner animation='grow' variant='primary' /> </ReactFlexyLoader> }
you can pass anything you want as a spinner. Child component will be centered on the div.
const App = {return <ReactFlexyLoader show> <div> <h4>Loading...<h4> </div></ReactFlexyLoader>};
if you want to make behind the loader non clickable you can pass pointerEvents props false. like:
const App = { return <ReactFlexyLoader show pointerEvents=false />}
You can also change the css position of the loader : "absolute,fixed,unset ...."
Note: if you want to move the loader when scroll downing. make position equal fixed
const App = { return <ReactFlexyLoader show position='fixed' />}
You can also change the location of the spinner : "bottom,middle,top"
const App = { return <ReactFlexyLoader show location='top' />}
you can change the z-index value if you want
const App = { return <ReactFlexyLoader show zIndex=9999 />}
Props
property | type | default | description |
---|---|---|---|
show | Boolean | false | shows the loader |
alpha | Number | 0.3 | alpha value of rgba |
zIndex | Number | 99 | zIndex value of the loader |
pointerEvents | Boolean | true | handle pointer events behind the loader |
location | String "middle", "top","bottom" | "middle" | handle the spinner location |
position | String "absolute","fixed","unset"... | "absolute" | css position of the loader |