All Projects → mantaskaveckas → React Siema

mantaskaveckas / React Siema

ReactSiema Demo

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Siema

Slider
Touch swipe image slider/slideshow/gallery/carousel/banner mobile responsive bootstrap
Stars: ✭ 2,046 (+2173.33%)
Mutual labels:  gallery, slider, carousel
Vue Glide
A slider and carousel as vue component on top of the Glide.js
Stars: ✭ 225 (+150%)
Mutual labels:  component, slider, carousel
React Spring Slider
A slider component for react
Stars: ✭ 118 (+31.11%)
Mutual labels:  component, slider, carousel
React Grid Carousel
React responsive carousel component w/ grid layout
Stars: ✭ 29 (-67.78%)
Mutual labels:  gallery, slider, carousel
Vue Gallery
📷 Responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers.
Stars: ✭ 405 (+350%)
Mutual labels:  gallery, slider, carousel
React Responsive Carousel
React.js Responsive Carousel (with Swipe)
Stars: ✭ 1,962 (+2080%)
Mutual labels:  gallery, slider, carousel
Vue Infinite Slide Bar
∞ Infinite slide bar component (no dependency and light weight 1.48 KB)
Stars: ✭ 190 (+111.11%)
Mutual labels:  component, slider, slide
Vue Slide Bar
🎢 A Simple Vue Slider Bar Component.
Stars: ✭ 129 (+43.33%)
Mutual labels:  component, slider, slide
Vue Picture Swipe
🖼 Vue Picture Swipe Gallery (a gallery of image with thumbnails, lazy-load and swipe) backed by photoswipe
Stars: ✭ 322 (+257.78%)
Mutual labels:  component, gallery, carousel
skeleton-carousel
Carousel component. Horizontal and vertical swipe navigation
Stars: ✭ 31 (-65.56%)
Mutual labels:  gallery, slider, carousel
React Whirligig
A react carousel/slider like component for sequentially displaying slides or sets of slides
Stars: ✭ 20 (-77.78%)
Mutual labels:  slider, carousel, slide
Simple Slider
🎠 The 1kb JavaScript Carousel
Stars: ✭ 583 (+547.78%)
Mutual labels:  slider, carousel, slide
Svelte Carousel
A super lightweight, super simple Carousel for Svelte 3
Stars: ✭ 144 (+60%)
Mutual labels:  slider, carousel, slide
Slendr
A responsive & lightweight (2KB gzipped) slider for modern browsers. [UNMAINTAINED]
Stars: ✭ 39 (-56.67%)
Mutual labels:  component, slider, slide
MediaSliderView
Pure java based, highly customizable media slider gallery supporting both images and videos for android.
Stars: ✭ 85 (-5.56%)
Mutual labels:  gallery, slider, carousel
Hooper
🎠 A customizable accessible carousel slider optimized for Vue
Stars: ✭ 561 (+523.33%)
Mutual labels:  slider, carousel, slide
Swiper
Most modern mobile touch slider with hardware accelerated transitions
Stars: ✭ 29,519 (+32698.89%)
Mutual labels:  gallery, slider, carousel
Hammer Slider
DISCONTINUED - HammerSlider touch is a lightweight infinite carousel plugin.
Stars: ✭ 21 (-76.67%)
Mutual labels:  slider, carousel
Egjs Flicking
🎠 ♻️ Everyday 30 million people experience. It's reliable, flexible and extendable carousel.
Stars: ✭ 937 (+941.11%)
Mutual labels:  slider, carousel
React Splide
The Splide component for React.
Stars: ✭ 32 (-64.44%)
Mutual labels:  slider, carousel

ReactSiema - Lightweight and simple carousel for React

ReactSiema is a lightweight carousel plugin for React. It's a wrapper based on decent library Siema.

Demo

Download on npm

Setup

npm install react-siema --save
import ReactSiema from 'react-siema'

const Slide = (props) => <img {...props} alt="slide" />

const App = () => <ReactSiema>
    <Slide src="#" />
    <Slide src="#" />
    <Slide src="#" />
</ReactSiema>

If you want to run a demo:

  • Clone the repo
  • run npm install
  • run npm start, which will setup a development server with sample gallery

Options

Component comes with some default settings, that can be adjusted via props.

resizeDebounce: 250
duration: 200
easing: 'ease-out'
perPage: 1
startIndex: 0
draggable: true
threshold: 20
loop: false

Example of passing custom options:

const Slide = (props) => <img {...props} alt="slide" />

const options = {
    duration: 500,
    loop: true
}

const App = () => <ReactSiema {...options}>
    <Slide src="#" />
    <Slide src="#" />
    <Slide src="#" />
</ReactSiema>

API

Most of the API comes from Siema library mentioned above.

  • next() - go to next slide
  • prev() - go to previous slide
  • goTo(index) - go to a specific slide
  • currentSlide - index of the current active slide (read only)

Example of API usage

API is accessible via refs.

const Slide = (props) => <img {...props} alt="slide" />

const App = () => {
    let slider
    
    return (
        <div>
            <ReactSiema ref={siema => slider = siema}>
                <Slide src="#" />
                <Slide src="#" />
                <Slide src="#" />
            </ReactSiema>
            <button onClick={() => slider.prev()}>prev</button>
            <button onClick={() => slider.next()}>next</button>
        </div>
    )
}

Click Events

This version of react-siema has been extended to include the ability to attach very simple click events to items passed into the slider. It will only fire the click event if the slide wasn't dragged.

Provide a normal event handler method the onClick prop in <ReactSiema>. Current slide information can be retrieved from the instance of siema. (this.slider.currentSlide below).

const Slide = (props) => <img {...props} alt="slide" />

class App extends Component {
    constructor() {
        this.slider = null;
    }

    handleClick = (e) => {
        console.log(`Index of the clicked slide is ${this.slider.currentSlide}`);
    }
    
    render() {
        return (
            <div>
                <ReactSiema ref={siema => this.slider = siema} onClick={this.handleClick}>
                    <Slide src="#" />
                    <Slide src="#" />
                    <Slide src="#" />
                </ReactSiema>
                <button onClick={() => slider.prev()}>prev</button>
                <button onClick={() => slider.next()}>next</button>
            </div>
        )
    }
}
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].