All Projects → bmcmahen → react-gesture-gallery

bmcmahen / react-gesture-gallery

Licence: other
a react image gallery with gesture support

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to react-gesture-gallery

React Grid Carousel
React responsive carousel component w/ grid layout
Stars: ✭ 29 (+107.14%)
Mutual labels:  gallery, carousel
Slider
Touch swipe image slider/slideshow/gallery/carousel/banner mobile responsive bootstrap
Stars: ✭ 2,046 (+14514.29%)
Mutual labels:  gallery, carousel
React Siema
ReactSiema Demo
Stars: ✭ 90 (+542.86%)
Mutual labels:  gallery, carousel
React Alice Carousel
React responsive component for building content galleries, content rotators and any React carousels
Stars: ✭ 419 (+2892.86%)
Mutual labels:  gallery, carousel
skeleton-carousel
Carousel component. Horizontal and vertical swipe navigation
Stars: ✭ 31 (+121.43%)
Mutual labels:  gallery, carousel
Nanogallery2
a modern photo / video gallery and lightbox [JS library]
Stars: ✭ 488 (+3385.71%)
Mutual labels:  gallery, gesture
Imageviewer
A simple and customizable Android full-screen image viewer 一个简单且可自定义的Android全屏图像浏览器
Stars: ✭ 1,889 (+13392.86%)
Mutual labels:  gallery, gesture
React Soft Slider
Simple, fast and impartial slider
Stars: ✭ 54 (+285.71%)
Mutual labels:  carousel, gesture
MediaSliderView
Pure java based, highly customizable media slider gallery supporting both images and videos for android.
Stars: ✭ 85 (+507.14%)
Mutual labels:  gallery, carousel
React Image Gallery
React carousel image gallery component with thumbnail support 🖼
Stars: ✭ 2,946 (+20942.86%)
Mutual labels:  gallery, carousel
Ngx Gallery
Angular Gallery, Carousel and Lightbox
Stars: ✭ 417 (+2878.57%)
Mutual labels:  gallery, carousel
ngx-image-gallery
Probably the best Angular 4+ modal and inline image gallery. Angular upgrade for ng-image-gallery.
Stars: ✭ 80 (+471.43%)
Mutual labels:  gallery, carousel
Vue Gallery
📷 Responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers.
Stars: ✭ 405 (+2792.86%)
Mutual labels:  gallery, carousel
Swiper
Most modern mobile touch slider with hardware accelerated transitions
Stars: ✭ 29,519 (+210750%)
Mutual labels:  gallery, carousel
Vue Picture Swipe
🖼 Vue Picture Swipe Gallery (a gallery of image with thumbnails, lazy-load and swipe) backed by photoswipe
Stars: ✭ 322 (+2200%)
Mutual labels:  gallery, carousel
React Responsive Carousel
React.js Responsive Carousel (with Swipe)
Stars: ✭ 1,962 (+13914.29%)
Mutual labels:  gallery, carousel
React Awesome Slider
React content transition slider. Awesome Slider is a 60fps, light weight, performant component that renders an animated set of production ready UI general purpose sliders with fullpage transition support for NextJS and GatsbyJS. 🖥️ 📱
Stars: ✭ 2,343 (+16635.71%)
Mutual labels:  gallery, carousel
react-native-image-page
react-native image-carousel with zoom-pan gestures and full-screen support, work on both iOS and Android
Stars: ✭ 19 (+35.71%)
Mutual labels:  gallery, carousel
react-gallery-carousel
Mobile-friendly gallery carousel 🎠 with server side rendering, lazy loading, fullscreen, thumbnails, touch, mouse emulation, RTL, keyboard navigation and customisations.
Stars: ✭ 178 (+1171.43%)
Mutual labels:  gallery, carousel
basicSlider
A slider in its purest form.
Stars: ✭ 27 (+92.86%)
Mutual labels:  gallery
A demo showing images being swiped left or right.

react-gesture-gallery

npm package Follow on Twitter

A simple image gallery built with react which works nicely on desktop and mobile devices. View the demo

Install

Install react-gesture-gallery and its peer dependency, react-gesture-responder using yarn or npm.

yarn add react-gesture-gallery react-gesture-responder

Basic usage

By default, the gallery will attempt to fit into its container using height: 100% and width: 100%, so you should generally provide a container with a set width and height. For a full-screen gallery, using width: 100vw and height: 100vh. Note that this library doesn't display in a modal by default, but it's easy enough to provide your own.

The example gif above is generated by this code:

import * as React from "react";
import { Gallery, GalleryImage } from "react-gesture-gallery";

function Example() {
  const [index, setIndex] = React.useState(0);

  const images = [
    {
      src:
        "https://images.unsplash.com/photo-1557958114-3d2440207108?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1950&q=80"
    },
    {
      src:
        "https://images.unsplash.com/photo-1557939403-1760a0e47505?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1931&q=80"
    },
    {
      src:
        "https://images.unsplash.com/photo-1558029062-a37889b87526?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=975&q=80"
    },
    {
      src:
        "https://images.unsplash.com/photo-1558088458-b65180740294?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1579&q=80"
    },
    {
      src:
        "https://images.unsplash.com/photo-1558039719-79cb7b60d279?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1950&q=80"
    }
  ];

  return (
    <div style={{ background: "black", width: "100vw", height: "100vh" }}>
      <Gallery
        index={index}
        onRequestChange={i => {
          setIndex(i);
        }}
      >
        {images.map(img => (
          <GalleryImage objectFit="contain" key={img.src} src={img.src} />
        ))}
      </Gallery>
    </div>
  );
}

API

Gallery

Name Type Default Value Description
index * number The index of gallery to show
onRequestChange * (i: number) => void; A callback requesting the active image change
enableKeyboard boolean true Enable keyboard controls
children * GalleryImage[] A set of gallery images to diplay
enableControls boolean true Enable back and forward arrows
enableIndicators boolean true Enable back and forward indicators

GalleryImage

Name Type Default Value Description
src * string The image source
srcSet string The image source set
alt string Alt tag for the image
objectFit 'cover | contain' contain How to display the image

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].