Smarter image component that has a blurred preview and a possibility to use WebP image type. It can also adjust to a device width. Feel free to check it out!
npm install --save react-boosted-image
import * as React from 'react'
import { BoostedImage } from 'react-boosted-image'
class Example extends React.Component {
render () {
return (
<BoostedImage
alt={"example"}
sources={{
breakpoints: [900],
webpSrcSet: [
"/assets/your-image-for-width-less-than-900.webp",
"/assets/your-image-for-width-more-than-900.webp"
],
fallbackSrcSet: [
"/assets/your-image-for-width-less-than-900.jpg",
"/assets/your-image-for-width-more-than-900.jpg"
]
}}
width="640"
height="540"
lazyMode={true}
/>
)
}
}
MIT
Version | Tag | Published |
---|---|---|
1.0.3 | latest | 4yrs ago |