All Projects → ethanselzer → React Image Magnify

ethanselzer / React Image Magnify

Licence: mit
A responsive image zoom component designed for shopping sites.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Image Magnify

awesome-ecommerce
Collect and develop Open Source or Free Projects for building ecommerce platform easy and fast and free
Stars: ✭ 39 (-90.03%)
Mutual labels:  ecommerce, store, shopping
Atgmediabrowser
Image slide-show viewer with multiple predefined transition styles, with ability to create new transitions with ease.
Stars: ✭ 186 (-52.43%)
Mutual labels:  image, photo, zoom
Color.js
Extract colors from an image (0.75 KB) 🎨
Stars: ✭ 42 (-89.26%)
Mutual labels:  image, photo, picture
Medium Zoom
🔎🖼 A JavaScript library for zooming images like Medium
Stars: ✭ 2,799 (+615.86%)
Mutual labels:  image, picture, zoom
Stfalconimageviewer
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures
Stars: ✭ 1,734 (+343.48%)
Mutual labels:  image, photo, zoom
Vue Product Zoomer
Zoom Prodct Image, useful for e-shop website
Stars: ✭ 248 (-36.57%)
Mutual labels:  product, image, zoom
CakeShop
eCommerce website with cakephp
Stars: ✭ 19 (-95.14%)
Mutual labels:  ecommerce, store
dummy-products-api
An api to fetch dummy e-commerce product 👕 👗 👖 👚 JSON data with placeholder images.
Stars: ✭ 102 (-73.91%)
Mutual labels:  ecommerce, product
framework
Core package for avored shopping cart
Stars: ✭ 72 (-81.59%)
Mutual labels:  ecommerce, shopping
Rxgalleryfinal
图片选择库,单选/多选、拍照、裁剪、压缩,自定义。包括视频选择和录制。
Stars: ✭ 2,798 (+615.6%)
Mutual labels:  image, photo
CliqApp
This is a e-commerce app build over react native runs over android & ios.
Stars: ✭ 64 (-83.63%)
Mutual labels:  ecommerce, shopping
ionic-multi-camera
Take multiple photos one after another
Stars: ✭ 12 (-96.93%)
Mutual labels:  picture, photo
Pyinstastories
Python script to download Instagram stories from Instagram users.
Stars: ✭ 260 (-33.5%)
Mutual labels:  image, picture
saleor
A modular, high performance, headless e-commerce platform built with Python, GraphQL, Django, and React.
Stars: ✭ 15,824 (+3947.06%)
Mutual labels:  ecommerce, store
solidus graphql api
GraphQL comes to Solidus!
Stars: ✭ 28 (-92.84%)
Mutual labels:  ecommerce, store
cartify
Shopping Cart implementation to serve as a shell for building e-commerce apps | Angular 7, Node.js, MongoDB
Stars: ✭ 22 (-94.37%)
Mutual labels:  ecommerce, shopping
hms-image-vision-java
This sample code is to guide the developer how to integrate the Image Vision Sub-service of the Image Kit, calling the image filter function. This sub-service provides 24 unique filter effects to enhance the artistic conception and artistic sense of the images.
Stars: ✭ 22 (-94.37%)
Mutual labels:  picture, photo
Flutter photo manager
Provide flutter with the ability to manage photos.
Stars: ✭ 294 (-24.81%)
Mutual labels:  image, photo
Flutter photo
Pick image/video from album by flutter. Support ios and android. UI by flutter, no native.
Stars: ✭ 285 (-27.11%)
Mutual labels:  image, photo
Fdtake
Easily take a photo or video or choose from library
Stars: ✭ 314 (-19.69%)
Mutual labels:  image, photo

react-image-magnify

A responsive React image zoom component for touch and mouse.

Designed for shopping site product detail.

Features Include:

  • In-place and side-by-side image enlargement
  • Positive or negative space guide lens options
  • Interaction hint
  • Configurable enlarged image dimensions
  • Optional enlarged image external render
  • Hover intent
  • Long-press gesture
  • Fade transitions
  • Basic react-slick carousel support

Status

CircleCI Coverage Status npm License

Demo

Please visit the react-image-magnify demo site

Experiment with react-image-magnify live on CodePen. Use the Change View button to select editing mode or for different layout options. Use the Fork button to save your changes.

Installation

npm install react-image-magnify

Usage

If you are upgrading from v1x to v2x, please see the release notes.

import ReactImageMagnify from 'react-image-magnify';
...
<ReactImageMagnify {...{
    smallImage: {
        alt: 'Wristwatch by Ted Baker London',
        isFluidWidth: true,
        src: watchImg300
    },
    largeImage: {
        src: watchImg1200,
        width: 1200,
        height: 1800
    }
}} />
...

See more usage examples in the example project.

Required Props

Prop Type Default Description
smallImage Object N/A Small image information. See Small Image below.
largeImage Object N/A Large image information. See Large Image below.

Optional Styling Props

Prop Type Default Description
className String N/A CSS class applied to root container element.
style Object N/A Style applied to root container element.
imageClassName String N/A CSS class applied to small image element.
imageStyle Object N/A Style applied to small image element.
lensStyle Object N/A Style applied to tinted lens.
enlargedImageContainerClassName String N/A CSS class applied to enlarged image container element.
enlargedImageContainerStyle Object N/A Style applied to enlarged image container element.
enlargedImageClassName String N/A CSS class applied to enlarged image element.
enlargedImageStyle Object N/A Style applied to enlarged image element.

Optional Interaction Props

Prop Type Default Description
fadeDurationInMs Number 300 Milliseconds duration of magnified image fade in/fade out.
hoverDelayInMs Number 250 Milliseconds to delay hover trigger.
hoverOffDelayInMs Number 150 Milliseconds to delay hover-off trigger.
isActivatedOnTouch Boolean false Activate magnification immediately on touch. May impact scrolling.
pressDuration Number 500 Milliseconds to delay long-press activation (long touch).
pressMoveThreshold Number 5 Pixels of movement allowed during long-press activation.

Optional Behavioral Props

Prop Type Default Description
enlargedImagePosition String beside (over for touch) Enlarged image placement. Can be 'beside' or 'over'.
enlargedImageContainerDimensions Object {width: '100%', height: '100%'} Specify enlarged image container dimensions as an object with width and height properties. Values may be expressed as a percentage (e.g. '150%') or a number (e.g. 200). Percentage is based on small image dimension. Number is pixels. Not applied when enlargedImagePosition is set to 'over', the default for touch input.
enlargedImagePortalId String N/A Render enlarged image into an HTML element of your choosing by specifying the target element id. Requires React v16. Ignored for touch input by default - see isEnlargedImagePortalEnabledForTouch.
isEnlargedImagePortalEnabledForTouch Boolean false Specify portal rendering should be honored for touch input.
hintComponent Function (Provided) Reference to a component class or functional component. A Default is provided.
shouldHideHintAfterFirstActivation Boolean true Only show hint until the first interaction begins.
isHintEnabled Boolean false Enable hint feature.
hintTextMouse String Hover to Zoom Hint text for mouse.
hintTextTouch String Long-Touch to Zoom Hint text for touch.
shouldUsePositiveSpaceLens Boolean false Specify a positive space lens in place of the default negative space lens.
lensComponent Function (Provided) Specify a custom lens component.

Small Image

{
    src: String, (required)
    srcSet: String,
    sizes: String,
    width: Number, (required if isFluidWidth is not set)
    height: Number, (required if isFluidWidth is not set)
    isFluidWidth: Boolean, (default false)
    alt: String,
    onLoad: Function,
    onError: Function
}

For more information on responsive images, please try these resources:
Responsive Images 101
Responsive Images - The srcset and sizes Attributes

Large Image

{
    src: String, (required)
    srcSet: String,
    sizes: String,
    width: Number, (required)
    height: Number, (required)
    alt: String, (defaults to empty string)
    onLoad: Function,
    onError: Function
}

Support

Please open an issue.

Example Project

git clone https://github.com/ethanselzer/react-image-magnify.git
cd react-image-magnify
npm install
npm run build
cd example
yarn
yarn start

If your default browser does not start automatically, open a new browser window and go to localhost:3000

Development

git clone https://github.com/ethanselzer/react-image-magnify.git
cd react-image-magnify
npm install
npm run #See available commands

The Example Project may be used in development.

To rebuild the source automatically when changes are made, run yarn run build-watch.

Contributing

Please contribute using Github Flow. Create a branch, add commits, and open a pull request.

Attribution

Thanks to the following community members for opening Issues and Pull Requests.

@damien916
@colepatrickturner
@andreatosatto90
@nathanziarek
@hombrew
@smashercosmo
@sk1e
@vidries
@ionutzp
@sbloedel
@spiderbites
@Akarshit
@eddy20vt
@evannoronha
@benjaminadk
@nilsklimm
@m4recek
@yaser-ali-vp
@carlgunderson
@tojvan
@kskonecka
@Coriou

You are awesome! ✨💫

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].