0.11.5 • Published 3 years ago

react-elastic-carousel v0.11.5

Weekly downloads
12,713
License
MIT
Repository
github
Last release
3 years ago

react-elastic-carousel

A flexible and responsive carousel component for react

NPM npm npm bundle size

Why do we need yet another carousel component

  • Element resize support (true responsiveness)
    Most of the carousel components are responsive to the viewport size, but this is not a real responsive support as we can have an element with a width:500px on a 1200px screen, most carousel component will "think" we are on a 1200px mode because they "watch" the view-port's size and not the wrapping element's size. This is the reason why react-eleastic-carousel is using the resize-observer which gives us a true responsive support, not matter on what screen size we are.

  • RTL (right-to-left) support
    Supporting right-to-left languages requires a full support for right-to-left rendering and animations which is not supported in most of the carousel components out there. also, right-to-left support is important and should be a standard for most applications.

Live Demos & Docs

Install

npm install --save react-elastic-carousel

or

yarn add react-elastic-carousel

Note

react-elastic-carousel is using styled-components for styling, this means that you should install it as well:

npm install --save styled-components

Usage

import React, { Component } from 'react';
import Carousel from 'react-elastic-carousel';

class App extends Component {
  state = {
    items: [
      {id: 1, title: 'item #1'},
      {id: 2, title: 'item #2'},
      {id: 3, title: 'item #3'},
      {id: 4, title: 'item #4'},
      {id: 5, title: 'item #5'}
    ]
  }

  render () {
    const { items } = this.state;
    return (
      <Carousel>
        {items.map(item => <div key={item.id}>{item.title}</div>)}
      </Carousel>
    )
  }
}

Playground

Edit react-elastic-carousel

Development

git clone https://github.com/sag1v/react-elastic-carousel.git
cd react-elastic-carousel
yarn

To run the docs site run

yarn start

to run a demo Application run

yarn demo

The application is running at http://localhost:8888

License

MIT © sag1v

0.11.5

3 years ago

0.11.5-beta.3

3 years ago

0.11.5-beta.2

3 years ago

0.11.5-beta.1

3 years ago

0.11.4

3 years ago

0.11.3

3 years ago

0.11.2

3 years ago

0.11.1

3 years ago

0.11.0

3 years ago

0.10.0

3 years ago

0.10.0-beta.1

3 years ago

0.10.0-beta

3 years ago

0.9.5

3 years ago

0.9.5-beta.2

3 years ago

0.9.5-beta.1

3 years ago

0.9.4

3 years ago

0.9.2-beta.3

3 years ago

0.9.3

3 years ago

0.9.2-beta.2

3 years ago

0.9.2-beta

3 years ago

0.9.1

3 years ago

0.9.0

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.9

4 years ago

0.7.8

4 years ago

0.7.6

4 years ago

0.7.7

4 years ago

0.7.5

4 years ago

0.7.4

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.7

4 years ago

0.6.6

4 years ago

0.6.3

4 years ago

0.6.4

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.3.1

4 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.22

6 years ago

0.1.21

6 years ago

0.1.20

6 years ago

0.1.19

6 years ago

0.1.18

6 years ago

0.1.17

6 years ago

0.1.16

6 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago