2.0.0 • Published 10 months ago

next-medium-zoom v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

next-medium-zoom

A React component for zooming Next.js Image components with smooth animations and customizable options.

nmz

Installation

npm install next-medium-zoom

Usage

import { ZoomWrapper } from "next-medium-zoom";
import Image from "next/image";

export default function YourComponent() {
  return (
    <ZoomWrapper
      zoomFactor={1.5}
      bgColor="#000000"
      overlayOpacity={0.8}
      enableAnimation={true}
    >
      <Image
        src="/image.png"
        alt="image alt text"
        width={400}
        height={300}
        className="z-50"
      />
    </ZoomWrapper>
  );
}

Props

PropTypeDefaultDescription
childrenReactElement(required)The Next.js Image component or any element to be wrapped inside the zoom functionality.
zoomFactornumber2The factor by which the image should zoom in when clicked.
bgColorstring"black"The background color of the overlay when the image is zoomed in, in any valid CSS color format.
overlayOpacitynumber0.75Opacity level of the background overlay when zoomed in.
enableAnimationbooleantrueWhether to animate the zoom effect when transitioning in and out.

TODOs

  • Add animation variant options as props
  • Custom wrapper class extension
  • Optimize implementation
2.0.0

10 months ago

1.3.8

10 months ago

1.3.6

10 months ago

1.3.5

10 months ago

1.3.4

10 months ago

1.3.3

10 months ago

1.3.2

10 months ago

1.3.1

10 months ago

1.3.0

10 months ago

1.2.0

10 months ago

1.1.0

10 months ago

1.0.0

10 months ago