react-async-image
ReactJS 'img' tag rendering with loading styles, async decoding and error fallback.
Note: required React v16.8+
Install
npm i -S react-async-image
Usage
;; div className="wrapper" /div
Props
name | description | type | default |
---|---|---|---|
src | The image URL | string | |
alt? | An alternative text description of the image | string | |
decoding? | Decoding hint to the browser | auto | sync | async | async |
loading? | auto | eager | lazy | lazy | |
className? | CSS class of the image | string | async-image |
placeholder? | A fallback element if the image could be loaded | React.ReactNode | string |