LazySizes component for ReactJS base on lazysizes
Note: If you're still using React 0.13, please continue to use react-lazysizes@0.2.x
.
npm install --save react-lazysizes
bower install --save react-lazysizes
var LazySizes = require('react-lazysizes');
<LazySizes width='1920' height='1024' dataSrc='http://lorempixel.com/1920/1024/sports/1'/>
<script src="path/to/react-lazysizes/dist/react-lazysizes.js"></script>
//...
var LazySizes = window.ReactLazysizes;
//...
Example here
Name | Type | Default |
---|---|---|
src | string | 'data:image/gif;base64,R0lGODdhEAAJAIAAAMLCwsLCwiwAAAAAEAAJAAACCoSPqcvtD6OclBUAOw==' |
dataSrc | string | |
dataSizes | string | 'auto' |
dataSrcSet | [string, object, array] | |
className | string | '' |
iframe | bool | false |
width | string or number | |
height | string or number |
More info see lazysizes api.
View demo or example folder.