ben-x9 / react-instagram-zoom-slider

πŸŒ„β†”οΈ A slider component with pinch to zoom capabilities inspired by Instagram

Home Page:https://skozer.github.io/react-instagram-zoom-slider/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

Prop Description Default
slides List of slides to render Required
maxScale Maximum zoom level 4
minScale Minimum zoom level 1
slideOverlay Content to overlay on the slider null
slideIndicatorTimeout Time in milliseconds until the slide indicator fades out.
Set to null to disable this behavior.
5000
activeDotColor Pagination dot color for the active slide #4e99e9
dotColor Pagination 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.

ezoic increase your site revenue

About

πŸŒ„β†”οΈ A slider component with pinch to zoom capabilities inspired by Instagram

https://skozer.github.io/react-instagram-zoom-slider/

License:MIT License


Languages

Language:JavaScript 96.1%Language:HTML 2.1%Language:CSS 1.8%