Giter Club home page Giter Club logo

react-modal-images's Introduction

React Modal Images

A lightweight React component providing modal image.

Live DEMO

Features

  • Only 2.3 kB when gzipped.
  • Zero dependencies.
  • Includes builds for CommonJS and ES modules.
  • For React 16.x, 17.x and 18.x.
  • Download and Zoom Buttons can be hidden.
  • Image alt shown as title of Modal Image.
  • Background color of transparent images can be overridden.

Usage

import React from 'react';
import { RModalImages } from 'react-modal-images';

interface IAppProps {}

export const App: React.FC<IAppProps> = () => {
    return (
        <div className="App">
            <RModalImages
                small={'https://dummyimage.com/420x200/000/aaa'}
                medium={'https://dummyimage.com/720x400/000/aaa'}
                large={'https://dummyimage.com/1020x800/000/aaa'}
                alt={'An alternate text for this image'}
            />
        </div>
    );
};
Prop Type Description
className string Optional. Class name for the small preview image.
alt string Optional. An alternate text for the small image.
small string Required. Src for the small preview image.
smallSrcSet string Optional. SrcSet for the small preview image.
medium string Optional. If large is defined. Image shown when zoomed out in modal.
large string Optional. If medium is defined. Image shown when zoomed in modal. Downloadable.
hideDownloadButton boolean Optional. Set to true to hide download-button from the modal.
hideZoomButton boolean Optional. Set to true to hide zoom-button from the modal.
hideRotateButton boolean Optional. Set to true to hide rotate-button within the modal.
imageBackgroundColor string Optional. Background color of the image shown in modal. Defaults to black.

react-modal-images's People

Contributors

me5ut avatar

Stargazers

 avatar Ahmet İlhan avatar

Watchers

 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.