1.4.0 • Published 4 years ago

react-instagram-zoom-slider v1.4.0

Weekly downloads
245
License
MIT
Repository
github
Last release
4 years ago

react-instagram-zoom-slider is a slider component with pinch to zoom capabilities inspired by Instagram.

NPM npm bundle size

Example

react-instagram-zoom-slider demo

👉 View this interactive demo here

Install

yarn add react-instagram-zoom-slider react-spring react-use-gesture styled-components

Usage

import React, { Component } from 'react'
import ZoomSlider from 'react-instagram-zoom-slider'

function App() {
  const slides = [<img src="..." alt="First slide" />, <img src="..." alt="Second slide" />]

  return <ZoomSlider slides={slides} />
}

Common Props

Common props you may want to specify include:

PropDescriptionDefault
slidesList of slides to renderRequired
initialSlideIndex of the slide to be rendered by default0
maxScaleMaximum zoom level4
minScaleMinimum zoom level1
slideOverlayContent to overlay on the slidernull
slideIndicatorTimeoutTime in milliseconds until the slide indicator fades out.Set to null to disable this behavior.5000
activeDotColorPagination dot color for the active slide#4e99e9
dotColorPagination dot color for all other slides#dadbdc

Building a custom slider

If you need to customize the slider components beyond what is available via props, you can use the useSlider and useZoom hooks to build your own components with slide and zoom functionality.

License

MIT Licensed. Copyright © Sean Kozer 2020.

1.4.0

4 years ago

1.3.0

4 years ago

1.3.0-beta.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.0.2

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago