Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
react-picture
Advanced tools
React component for rendering responsive images. Attempts to implement <img srcset=...>
support in non-compliant browsers, otherwize renders the native <img srcset>
. Will eventually support Picture & Source elements.
npm install react-picture
Then use in your react app like so:
var Img = require('react-picture').Image;
...
render: function() {
var imgs = '//placebacon.net/200/150 600w, //placebacon.net/300/300 800w';
return (
<Img alt='Your picture description' srcSet={imgs} extra={{className='myImg'}}/>
);
}
...
The following properties can be passed to the Image component:
alt
- Required and describes your picturesrcSet
- Required and consists of a string formated like srcsetextra
- Optional object which contains properties that will be put on img tag<img srcset>
when supportedv0.0.4 (Upcoming)
FAQs
Responsive images component for React.JS
The npm package react-picture receives a total of 1 weekly downloads. As such, react-picture popularity was classified as not popular.
We found that react-picture demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.