Giter Site home page Giter Site logo

mohammadarsalan / react-draggable-image-viewer Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2.29 MB

A slack like image viewer for react.

License: MIT License

JavaScript 91.67% CSS 7.82% HTML 0.50%
react zoom zoom-images image-viewer slack component javascript draggable draggableview draggableimage

react-draggable-image-viewer's Introduction

react-draggable-image-viewer

React Draggable image zoom component A slack like image viewer for react.

Demo 1

Demo 2

Usage

Install the package using NPM:

npm install react-draggable-image-viewer --save

Add the component to your React application:

import ImageView from "react-draggable-image-viewer";
import yourImage from "./path/to/image";

export default function ExampleComponent() {
  return <ImageView src=[yourImage] width={500} />;
}

Configuration

Prop Type Default Description
images (required) Array of String [] URL/path of the large image
onHide Function function() {} call when user click on close icon
isActive Boolean false will show and hide image view component
Draggable Boolean false allow to drag image
activePhotoIndex Number 0 start displaying image from given index
maxWidth Number 300 max Width will be use for calculate image aspect ratio
maxHeight Number 300 max Height will be use for calculate image aspect ratio

Development

Requirements: Node.js, Yarn

  1. Clone this repository: git clone [repo-url]
  2. Install all dependencies: yarn install
  3. Run yarn start to generate the library bundle using Webpack

Suggestions and contributions are always welcome! Please first discuss changes via issue before submitting a pull request.

react-draggable-image-viewer's People

Contributors

mohammadarsalan avatar

Watchers

 avatar  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.