1.0.1 • Published 6 years ago

react-retina-renderer v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

React Retina Renderer

React component for rendering retina images. This component was created with reference to react-retina-image

Installation

$ npm i -S react-retina-renderer

Demo

$ npm run dev
# and visit localhost:7777

Usage

import Image from 'react-retina-renderer';

/* ... */
<Image src={[IMG_SRC_1, IMG_SRC_2]} height={200} />
/* ... */

Properties

propertytyperequiredremark
srcarray of strings or stringoIf you want to render retina image on retina display, pass the array
altstringxAlternate text for an image
widthnumberxImage's width. If it is omitted, img will use auto or naturalWidth
heightnumberxImage's height. If it is omitted, img will use auto or naturalHeight
forceOriginalDimensionsboolxIf it is true, It will pass width and height as a real value to <img>
onLoadfunctionxCallback function which is triggered when image is loaded
onErrorfunctionxCallback function which is triggered when image is failed to load