1.1.3 • Published 4 years ago

react-image-fade-in v1.1.3

Weekly downloads
264
License
MIT
Repository
github
Last release
4 years ago

react-image-fade-in

Simple, no frills, component for fading in images. Just pass it a src prop.

NPM JavaScript Style Guide

Install

npm install --save react-image-fade-in

DEMO

Usage

import React, { Component } from "react";

import ImageFadeIn from "react-image-fade-in";

class Example extends Component {
  render() {
    return <ImageFadeIn width={640} height={480} src={imageSrc} />;
  }
}

Props

This a list of props that you can pass down to the component:

PropertyDescriptionDefault valueTypeRequired
srcimage source urlstringyes
loadAsBackgroundImageif false, renders as an IMG tag. If true, renders a DIV with image as the background-image (style css)falsebool
opacityTransitionDuration of the fade in, in seconds (s)0.5snumber
onClickonClick handlerfunction
HTML Global Attributesadd your own attributes (style, className, id, etc.)
HTML Event Attributesadd your own events (onBlur, onFocus, onMouseDown, etc.)

License

MIT © patricktran