New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

super-image

Package Overview
Dependencies
Maintainers
6
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

super-image

React component that render `` with nicer interface

  • 2.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

SuperImage

Greenkeeper badge Build Status devDependency Status peerDependency Status codecov

React component that render <img> with nicer interface

Install

$ npm install --save super-image

This package use Object.assign(), so you may need to polyfill via object.assign.

Usage

<SuperImage
  src="image.png"
  width="160"
  height="90"
  alt="super-image"
  fit="contain"
/>

Use <picture> element

Set sources property.

<SuperImage
  src="image.png"
  sources={[{
    srcSet : 'image.webp',
    type   : 'image/webp'
  }]}
  width="160"
  height="90"
  alt="super-image"
  fit="contain"
/>

Use object-fit fallback

Set fitFallback property true.

<SuperImage
  fitFallback
  src="image.png"
  width="160"
  height="90"
  alt="super-image"
  fit="contain"
/>

Config

PropertyTypeDescriptionDefault valueRequired
srcStringImage url-Yes
sourcesArraySets of <source> attributes: srcSet, sizes, media and type[]No
widthDOMStringImage width-No
heightDOMStringImage height-No
altStringAlternative text for <img>""No
roleStringWAI-ARIA for <img>-No
classNameStringclassName property for component""No
flexibleBooleanMake component fluidfalseNo
fitStringCSS object-fit property for <img> (contain or cover)-No
fitFallbackBooleanForce component to use background-imagefalseNo

License

MIT © FRESH!

Keywords

FAQs

Package last updated on 15 Aug 2018

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