JSPM

react-medium-image-zoom

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 196607
  • Score
    100M100P100Q175377F
  • License MIT

Medium.com style image zoom for React

Package Exports

  • react-medium-image-zoom

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-medium-image-zoom) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-medium-image-zoom

Installation

$ npm install --save react-medium-image-zoom

Usage

import ImageZoom from 'react-medium-image-zoom'

const MyComponent = (props) =>
  <div>
    <p>Some text...</p>

    <ImageZoom
      image={{
        src: 'bridge.jpg',
        alt: 'Golden Gate Bridge',
        className: 'img',
        style: {}
      }}
      zoomImage={{
        src: 'bridge-big.jpg',
        alt: 'Golden Gate Bridge',
        className: 'img--zoomed',
        style: {}
      }}
    />

    <p>Some text...</p>
  </div>

The component accepts three props:

  • image [ object | required ]: the original image
  • zoomImage [ object | optional ]: the image to be used for zooming
  • replaceImage [ boolean | optional | default true ]: once the image has been "zoomed" and downloaded the larger image, replace the original image. This is set to true by default.

Each one of these image props accepts four props:

  • src [ string | required ]: the source for the image
  • alt [ string | optional ]: the alt text for the image
  • className [ string | optional ]: classes to apply to the image
  • style [ object | optional ]: additional styles to apply to the image

Contribute

  1. Check out the issues
  2. Fork this repository
  3. Clone your fork
  4. Check out a feature branch ($ git checkout -b my-feature)
  5. Make your changes and push your branch to your GitHub repo
  6. Create a pull request from your branch to this repo's master branch
  7. When all is merged, pull down the upstream changes to your master
  8. Delete your feature branch