https://github.com/littlee/react-img-preloader
A Image preloader for React, aims for making image preloading dead-simple and easing the task of showing a running progress bar
https://github.com/littlee/react-img-preloader
image-loading image-preloader progressbar react react-component
Last synced: 5 months ago
JSON representation
A Image preloader for React, aims for making image preloading dead-simple and easing the task of showing a running progress bar
- Host: GitHub
- URL: https://github.com/littlee/react-img-preloader
- Owner: littlee
- License: mit
- Created: 2018-08-24T11:21:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-15T10:11:53.000Z (almost 7 years ago)
- Last Synced: 2025-09-21T05:33:49.101Z (5 months ago)
- Topics: image-loading, image-preloader, progressbar, react, react-component
- Language: JavaScript
- Homepage:
- Size: 128 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
React-Img-Preloader
A Image preloader for React, aims for making image preloading dead-simple and easing the task of showing a running progress bar
Install 💡
```bash
npm install react-img-preloader --save
```
How To Use 🥊
```js
import ImgPreloader from 'react-img-preloader'
// gather up all images you want for preload in an array
var images = [
require('/your/path/to/img1'),
require('/your/path/to/img2'),
require('/your/path/to/img3'),
// ... more goes here
]
{
console.log('All images are loaded')
}}>
{
({loaded, total}) =>
imgages planned for preload: {total}; images have been preloaded: {loaded}
}
```