GithubHelp home page GithubHelp logo

mrkhosravian / next-image-zoom Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 3.0 2.39 MB

Medium.com style image zoom for nextjs

Home Page: https://next-image-zoom.vercel.app/

TypeScript 88.58% JavaScript 11.42%
reactjs nextjs zoom next-image-zoom

next-image-zoom's Introduction

Next Image Zoom

Medium.com image zoom style for Next.js optimized image component

Demo

Please check Demo here.

next-image-zoom demo

Installation

Install package with npm

NPM

  npm install --save next-image-zoom

Yarn

  yarn add next-image-zoom

Usage/Examples

First import Zoom component

import Zoom from "next-image-zoom";

layout={'responsive'}

import Zoom from "next-image-zoom";

<div style={{width: 700}}>
    <Zoom src={image1} layout={"responsive"}/>
</div>

layout={'fill'}

import Zoom from "next-image-zoom";

<div style={{flex: "1", height: 300, backgroundColor: "yellow"}}>
    <Zoom src={image4} layout={"fill"} objectFit={"contain"}/>
</div>

layout={'fixed'}

import Zoom from "next-image-zoom";

<Zoom src={image2} layout={"fixed"} width={200} height={400}/>
import Zoom from "next-image-zoom";

<Zoom src={"/surface-LCOnczVeFio-unsplash-2.jpg"} layout={"responsive"} width={800} height={500}/>

License

MIT

Support

For support, email [email protected].

๐Ÿš€ About Me

I'm a full stack web developer that has hunger for learning new things ๐Ÿ˜‹

๐Ÿ”— Links

portfolio linkedin

next-image-zoom's People

Contributors

mrkhosravian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

next-image-zoom's Issues

Feature request - close onclick image

When my image is clicked / zoomed, I would like clicking on the image (not just the backdrop) to close it again.

I can add this in and PR if you approve of this concept. If prop.closeOnImageClick, don't check if the ref is being clicked.

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.