New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-placeholder-image

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-placeholder-image

Quickly mock up UI's with placeholder images.

latest
Source
npmnpm
Version
0.1.8
Version published
Weekly downloads
1.7K
-21.28%
Maintainers
1
Weekly downloads
 
Created
Source

🌄 React Placeholder Image

Quickly mock up UI's with placeholder images.

CustomPlaceholder

[Powered by https://placeholder.com]

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]

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,
});

FAQs

Package last updated on 14 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts