Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
react-imagezoomable
Advanced tools
wrapper to open an image in full screen and move inside with mouse and touch
npm install react-imagezoomable
You can find a good example on stoneisland30 You can find my storybook on https://multivoltage.github.io/react-imagezoomable/
import { ImageZoomable } from 'react-imagezoomable'
// options not required
const options = {
preloadHDtime: false,
placeHolderInside: true,
iconZoomInEnable: true,
percBigger: 25,
}
const fullImgAttr = {
srcSet: `ball.jpg 320w, ballBig.jpg 480w`,
sizes: `(max-width: 320px) 280px, (max-width: 480px) 440px, 800px`,
src: `ball.jpg`,
alt: `this is cool`,
// you can put other attributes...
}
<ImageZoomable imageAttr={fullImgAttr}>
<img src="ball.jpg" sizes="(max-width: 320px) 280px" src-set="ball.jpg 320w"/>
</ImageZoomable>
preloadHDtime
default = 0
It defines how much time in millisecond the component will wait before load a not visible version of full screen image. This can be useful is site host a large images (some megabytes), because probably when user click on the image, the full version is already loaded and user will not wait 10 second to download the image (thanks to cache)
placeHolderInside
default is false
it defines if the colored loading will be inside the small image or cover the full screen window
storybook-example
renderCustomPlaceholder
undefined
if this function is provided, the component will render a custom placeholder instead the original colored loading
storybook-example
iconZoomInEnable
default is false
it defines if at the top-right corner of small image a zoom-in icon will be draw
storybook-example
percBigger
default is 10
storybook-example
debug
default = false
if true you can see a red line in full screen image. This is useful for development
<ImageZoomable>
is only a wrapper around basic <img>
tagsrcset
and sizes
both for small image and fullscreen imagepreloadHDtime
prop introducedplaceHolderInside
prop introducediconZoomInEnable
prop introducesif you have installed this library version under 0.3.0, you have to specify hqWidth and hqHeight like this:
FAQs
wrapper to open an image in full screen and move inside with mouse and touch
The npm package react-imagezoomable receives a total of 0 weekly downloads. As such, react-imagezoomable popularity was classified as not popular.
We found that react-imagezoomable 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.