All Projects → jossmac → React Images

jossmac / React Images

Licence: mit
🌄 A mobile-friendly, highly customizable, carousel component for displaying media in ReactJS

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to React Images

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 (-92.3%)
Mutual labels:  responsive, carousel
React Elastic Carousel
A flexible and responsive carousel component for react https://sag1v.github.io/react-elastic-carousel
Stars: ✭ 173 (-92.52%)
Mutual labels:  carousel, responsive
React Items Carousel
Items Carousel Built with react-motion and styled-components
Stars: ✭ 150 (-93.51%)
Mutual labels:  carousel, responsive
Noodel Js
User interface for responsive, dynamic content trees
Stars: ✭ 173 (-92.52%)
Mutual labels:  carousel, responsive
nglp-angular-material-landing-page
NGLP is an Angular Material Landing Page.
Stars: ✭ 32 (-98.62%)
Mutual labels:  responsive, carousel
Angular2 Carousel
An lightweight , touchable and responsive library to create a carousel for angular 2 / 4 / 5
Stars: ✭ 26 (-98.88%)
Mutual labels:  carousel, responsive
Slider
Touch swipe image slider/slideshow/gallery/carousel/banner mobile responsive bootstrap
Stars: ✭ 2,046 (-11.51%)
Mutual labels:  carousel, responsive
Flutter Web Demo
🌍 Responsive web app powered by Flutter and Dart
Stars: ✭ 173 (-92.52%)
Mutual labels:  responsive
Startup Landing
Collection of free top of the line startup landing templates built using react/nextjs/gatsby. Free to download, simply edit and deploy! Updated weekly!
Stars: ✭ 176 (-92.39%)
Mutual labels:  responsive
Cassette
📼 A flexible media player component library for React that requires no up-front config
Stars: ✭ 171 (-92.6%)
Mutual labels:  responsive
Admin Template
JSF responsive admin template based on Bootstrap and AdminLTE
Stars: ✭ 170 (-92.65%)
Mutual labels:  responsive
Toucheffect
UI-responsive touch effects for Xamarin.Forms
Stars: ✭ 193 (-91.65%)
Mutual labels:  responsive
Baguettebox.js
⚡ Simple and easy to use lightbox script written in pure JavaScript
Stars: ✭ 2,252 (-2.6%)
Mutual labels:  responsive
Magnify
🖼 A jQuery plugin to view images just like in Windows. Browser support IE7+!
Stars: ✭ 177 (-92.34%)
Mutual labels:  responsive
Grid
This package has moved and renamed
Stars: ✭ 2,079 (-10.08%)
Mutual labels:  responsive
Argon Design System
Argon - Design System for Bootstrap 4 by Creative Tim
Stars: ✭ 2,307 (-0.22%)
Mutual labels:  responsive
Steam
A clean and minimal theme for Ghost.
Stars: ✭ 170 (-92.65%)
Mutual labels:  responsive
Shuffle
Categorize, sort, and filter a responsive grid of items
Stars: ✭ 2,170 (-6.14%)
Mutual labels:  responsive
Gatsby Starter Morning Dew
🚀 A Gatsby theme/starter to build lightning-fast blog/websites
Stars: ✭ 186 (-91.96%)
Mutual labels:  responsive
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 (+1.34%)
Mutual labels:  carousel

React Images

⚠️ Warning!

Don't use this in a new project. This package hasn't been properly maintained in a long time and there are much better options available.

Instead, try...


A mobile-friendly, highly customizable, carousel component for displaying media in ReactJS.

Browser support

Should work in every major browser... maybe even IE10 and IE11?

Getting Started

Start by installing react-images

npm install react-images

or

yarn add react-images

If you were using 0.x versions: library was significantly rewritten for 1.x version and contains several breaking changes. The best way to upgrade is to read the docs and follow the examples.

Please note that the default footer parses HTML automatically (such as <b>I'm bold!</b>) but it does not implement any form of XSS or sanitisation. You should do that yourself before passing it into the caption field of react-images.

Using the Carousel

Import the carousel from react-images at the top of a component and then use it in the render function.

import React from 'react'
import Carousel from 'react-images'

const images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }]

class Component extends React.Component {
  render() {
    return <Carousel views={images} />
  }
}

Using the Modal

Import the modal and optionally the modal gateway from react-images at the top of a component and then use it in the render function.

The ModalGateway will insert the modal just before the end of your <body /> tag.

import React from 'react'
import Carousel, { Modal, ModalGateway } from 'react-images'

const images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }]

class Component extends React.Component {
  state = { modalIsOpen: false }
  toggleModal = () => {
    this.setState(state => ({ modalIsOpen: !state.modalIsOpen }))
  }
  render() {
    const { modalIsOpen } = this.state

    return (
      <ModalGateway>
        {modalIsOpen ? (
          <Modal onClose={this.toggleModal}>
            <Carousel views={images} />
          </Modal>
        ) : null}
      </ModalGateway>
    )
  }
}

Advanced Image Lists

The simplest way to define a list of images for the carousel looks like:

const images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }]

However, react-images supports several other properties on each image object than just source. For example:

const image = {
  caption: "An image caption as a string, React Node, or a rendered HTML string",
  alt: "A plain string to serve as the image's alt tag",
  source: {
    download: "A URL to serve a perfect quality image download from",
    fullscreen: "A URL to load a very high quality image from",
    regular: "A URL to load a high quality image from",
    thumbnail: "A URL to load a low quality image from"
  };
}

All these fields are optional except source. Additionally, if using an object of URLs (rather than a plain string URL) as your source, you must specify the regular quality URL.

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].