1.0.46 • Published 1 month ago

@deesouza/galleryfy v1.0.46

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

GalleryFy

GalleryFy is a simple React library to show images and PDF files in the gallery.

Example GalleryFy

Prerequisites

  • Node v14+
  • NPM v6+

Install

npm i @deesouza/galleryfy

Usage

export default function Home() {
  const dataSource = [
    'https://cdn.images.com/image-1.png',
    'https://cdn.images.com/image-2.png',
    'https://cdn.images.com/image-3.png',
    'https://s29.q4cdn.com/175625835/files/doc_downloads/test.pdf'
  ];

  const [openIn, setOpenIn] = useState(0);
  const [open, setOpen] = useState(false);

  function handleOpen(index: number) {
    setOpenIn(index);
    setOpen(true);
  }

  return (
    <div>
      <GalleryFy
        open={open}
        dataSource={dataSource}
        startIn={openIn}
        handleClose={() => setOpen(false)}
      />

      <div>
        {dataSource.map((item, index) => (
          <div key={item} onClick={() => handleOpen(index)}>
            <span>{item}</span>
          </div>
        ))}
      </div>
    </div>
  );
}

You can also use images from assets.

import image1 from '@assets/images/image-1.jpg';

const images = [
    image1
];

Features

  • Zoom
  • Draggable
  • Rotate
  • Thumbnails
  • Navigation
  • Image Viewer
  • PDF Viewer

Contributing

Contributions, issues and feature requests are welcome. Feel free to check issues page.

License

Copyright © 2023 Diego Souza. This project is MIT licensed.

1.0.46

1 month ago

1.0.45

2 months ago

1.0.44

2 months ago

1.0.43

3 months ago

1.0.42

7 months ago

1.0.41

7 months ago

1.0.40

7 months ago

1.0.28

10 months ago

1.0.27

10 months ago

1.0.26

10 months ago

1.0.25

10 months ago

1.0.24

10 months ago

1.0.23

10 months ago

1.0.22

10 months ago

1.0.21

10 months ago

1.0.20

10 months ago

1.0.19

10 months ago

1.0.18

10 months ago

1.0.17

10 months ago

1.0.16

10 months ago

1.0.15

10 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago