react-preload-background

0.0.2 • Public • Published

react-preload-background

This package allows you to show a static preload image while image is preloaded and then transitions

Installation

npm install react-preload-background --save

Usage

  import React from 'react';
  import PreloadBackground from 'react-preload-background';
 
  export default (props) => {
    const {source, ...otherProps} = props;
    const localImage = '/path/to/local/asset';
 
    return(
      <PreloadBackground img={source} placeholder={localImage} {...otherProps}>
        <someOtherReactComponent />
      </PreloadBackground>
    );
  }

Props

prop type notes
img string Remote image to be loaded
placeholder string Local image to be immediately displayed

License

MIT License

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i react-preload-background

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • nicholas.b.carter