react-placeholder-images

0.0.3 • Public • Published

React Placeholder Images npm version

Image placeholder component, utilizing images from placeholder.com (formerly placehold.it).

Options

  • text
  • width
  • height (optional)
  • color
  • textColor
  • format

Usage

import { PlaceholderImage } from 'react-placeholder-images';
 
class Demo extends React.Component {
  render() {
    return (
      <PlaceholderImage
        width={500}
        height={225}
        color="F48942"
        textColor="FFFFFF"
        text="Text, color & textColor"
      />
      <br />
      <PlaceholderImage
        width={500}
        height={100}
        text="Text, no color"
      />
      <br />
      <PlaceholderImage
        width={500}
        height={100}
        color="1E5EFF"
      />
      <br />
      <PlaceholderImage
        width={500}
        format="png"
      />
    );
  }
}

Readme

Keywords

Package Sidebar

Install

npm i react-placeholder-images

Weekly Downloads

4

Version

0.0.3

License

MIT

Last publish

Collaborators

  • zhuber