0.1.8 • Published 4 years ago

react-placeholder-image v0.1.8

Weekly downloads
1,231
License
MIT
Repository
github
Last release
4 years ago

🌄 React Placeholder Image

Quickly mock up UI's with placeholder images.

CustomPlaceholder

Powered by https://placeholder.com

npm.io

Usage

Use the CustomPlaceholder React component

import { CustomPlaceholder } from 'react-placeholder-image';

Simple placeholder image

// simple, square image (width and height are required)
<CustomPlaceholder width={200} height={200} />

Complex placeholder image

// image with custom background-color, text, textColor, width, and height
<CustomPlaceholder
  width={200}
  height={100}
  backgroundColor="#123456"
  textColor="#ffffff"
  text="Hello World!"
/>

or simply generate an image URL to use in your own image component

import { generateCustomPlaceholderURL } from 'react-placeholder-image';

// simple sized image
const placeholderImageURL = generateCustomPlaceholderURL(200, 200);

// pass options to customize the background-color, text, and height
const otherPlaceholderImageURL = generateCustomPlaceholderURL(200, 100, {
  backgroundColor: '#123456',
  textColor: '#ffffff',
  text: 'Hello World!',
});

PhotoPlaceholder

Powered by https://picsum.photos

npm.io

Usage

Use the PhotoPlaceholder React component

import { PhotoPlaceholder } from 'react-placeholder-image';

Simple photo placeholder image

// simple, square image (width and height are required)
<PhotoPlaceholder width={200} height={200} />

Grayscale photo placeholder image

// image with grayscale option
<PhotoPlaceholder width={200} height={100} grayscale />

or simply generate an image URL to use in your own image component

import { generatePhotoPlaceholderURL } from 'react-placeholder-image';

// simple sized image
const placeholderImageURL = generatePhotoPlaceholderURL(200, 200);

// pass options to get grayscale
const otherPlaceholderImageURL = generatePhotoPlaceholderURL(200, 100, {
  grayscale: true,
});
0.1.8

4 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.5

5 years ago

0.1.0

5 years ago