1.9.7 • Published 4 years ago

@humblejs/img v1.9.7

Weekly downloads
5
License
Apache-2.0
Repository
-
Last release
4 years ago

Img

Image with low resolution support. Low res image is loaded and once high res is ready, low res is replaced with high res.

Demo

Install

yarn add @humblejs/img

Props

NameType / DescriptionIs Required?Default
classNamestringExtra class on top of default co-imgNoEmpty
srcstringHigh resolution image sourceYes
srcLowResolutionstringLow resolution image sourceNosrc value
altstringImage alt tagYes
fallbackcomponentFallback component when image could not be loaded. This acts as a placeholder for error.No
onLoadfuncCallback when high-res image was successfully loadedNo
onErrorfuncCallback if there was problem in loading imageNo
typestring (img, div) Load <img> tag or <div> with background image tagNoimg