1.0.3 • Published 6 years ago
react-progressive-component v1.0.3
react-progressive-component
Example
Installation
$ npm install react-progressive-component --save (or yarn add ...)
Usage
Div
<ProgressiveImg
src={pic1}
loader={small_pic1}
loaderStyle={'min-width: 100vw;height: 100vh;'}
>
<div
style={{
minWidth: '100vw', height: '100vh',
background: `url(${pic1}) center center / cover no-repeat`
}}
/>
</ProgressiveImg>
Img
<ProgressiveImg
src={pic2}
loader={small_pic2}
loaderStyle={'width: 100vw'}
>
<img
src={pic2}
style={{ width: '100vw' }}
/>
</ProgressiveImg>
Property
Prop | Type | Required | Default | Description |
---|---|---|---|---|
src | string | yes | ------ | Origin image |
loader | string | yes | ------ | Compress image |
loaderStyle | string | option | filter: blur(10px); | The style of the loader. |
CONTRIBUTING
All contributions and stars are super welcome! Please feel free to pull request.
LICENSE
MIT