Coder Social home page Coder Social logo

psykosoldi3r / react-instagram-zoom-slider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skozer/react-instagram-zoom-slider

0.0 1.0 0.0 5.74 MB

๐ŸŒ„โ†”๏ธ A slider component with pinch to zoom capabilities inspired by Instagram

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

License: MIT License

HTML 2.13% JavaScript 96.01% CSS 1.86%

react-instagram-zoom-slider's Introduction

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
initialSlide Index of the slide to be rendered by default 0
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.

react-instagram-zoom-slider's People

Contributors

skozer avatar semantic-release-bot avatar dependabot[bot] avatar muhraff avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.