Socket
Socket
Sign inDemoInstall

react-placeholdit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-placeholdit

React component to display placeholdit images


Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

React Placeholdit

Circle CI codecov.io dependencies

A simple React component to display placehold.it images.

Installation

npm install react-placeholdit

Usage

To use this component first import it using your favorite module loader. In this example we will be using the new ES6 module syntax.

import Placeholdit from 'react-placeholdit'

Once you have access to the Placeholdit component, use it as any other react component. The Placeholdit component requires you to define it's dimensions.

<Placeholdit width="100" height="100" />

This will render

<img src="https://placehold.it/100x100" />

The Placeholdit component also allows you to pass any other props, like className, style or alt. These will go straight to the rendered img tag.

Options

<Placeholdit
  width={Number}  // required
  height={Number} // (default: width)
  format={String} // {gif,png,jpg,jpeg} (default: gif) 
  children={
    Function(src, props) => ReactElement
    // you can use a children callback function that receives the generated `src`
    // and use as you wish
  }
  />

Keywords

FAQs

Package last updated on 18 Aug 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc