npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-imagezoomable

v1.1.4

Published

wrapper to open an image in full screen and move inside with mouse and touch

Downloads

10

Readme

Install

react-imagezoomable

    npm install react-imagezoomable

Demo

You can find a good example on stoneisland30 You can find my storybook on https://multivoltage.github.io/react-imagezoomable/

Usage

    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} options={options}>
        <img src="ball.jpg" sizes="(max-width: 320px) 280px" src-set="ball.jpg 320w"/>
    </ImageZoomable>

Options

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) storybook-example

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

New Version 1.0.0 (Breacking-changes)

  • now <ImageZoomable> is only a wrapper around basic <img> tag
  • user can use srcset and sizes both for small image and fullscreen image
  • preloadHDtime prop introduced
  • placeHolderInside prop introduced
  • iconZoomInEnable prop introduces

New Versions 0.3.0

  • now imageHd sizes are calculated at runtime, and user can use this library without know the source image -> FINALLY :)

New Versions 0.2.1

  • fix fadeInMillis props

New Versions 0.2.0

  • add percBigger and fadeInMillis props
  • NOW WORK ALSO IN TOUCH SCREEN DEVICE

Warning

if you have installed this library version under 0.3.0, you have to specify hqWidth and hqHeight like this:

  • hqWidth={1200} hdHeight={900}