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

placeholder

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

placeholder

Ridiculously simple and lightweight placeholders.

latest
Source
npmnpm
Version
1.2.3
Version published
Maintainers
1
Created
Source

PlaceholderJS

Ridiculously Simple and Lightweight Placeholders

npm npm downloads bundle size license

NPM

To use PlaceholderJS with React or any React framework, simply install via NPM or your preferred package manager:

npm i placeholder
yarn add placeholder
pnpm add placeholder

Next, import the package:

import {Placeholder} from 'placeholder';

NextJS Example

import { Placeholder } from "placeholder";

<Placeholder width="500" height="500" />

Size

Required

Specify the size of the placeholder image by adding the width and height to the component. Example:

<Placeholder width="500" height="500"/>

Text

Optional

Specify custom text in the placeholder image by adding your text. Example:

<Placeholder width="500" height="500" text="Hello World!"/>

Text Color

Optional

Specify the text color by adding color= to the component. We support HEX values or named values (e.g., white). Example:

<Placeholder width="500" height="500" text="Hello World!" color="#fff"/>

Background Color

Optional

Specify the background color by adding background= to the component. We support HEX values or named values (e.g., white). Example:

<Placeholder width="500" height="500" background="#000"/>

CDN

To use PlaceholderJS via the CDN for simplicity and/or compatibility with non-JS tools, you can use the scheme:

https://placeholderjs.com/HEIGHTxWIDTH

All image placeholders must have a height and width defined.

Size

Required

Specify the size of the placeholder image by adding the width and height to the URL. Example:

https://placeholderjs.com/500x500

Text

Optional

Specify custom text in the placeholder image by adding your text to the URL. Use a + character for spaces. Example:

https://placeholderjs.com/500x500&text=Hello+World!

Text Color

Optional

Specify the text color by adding color= to the URL. We support HEX values or named values (e.g., white). Since we can't use # for the color code, use an underscore _ before the HEX code. Example:

https://placeholderjs.com/500x500&text=Hello+World!&color=_fff

Background Color

Optional

Specify the background color by adding background= to the URL. We support HEX values or named values (e.g., white). Since we can't use # for the color code, use an underscore _ before the HEX code. Example:

https://placeholderjs.com/500x500&background=_000

Keywords

placeholder

FAQs

Package last updated on 09 Jan 2025

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