Skip to content

thomasmaclean/react-flickity

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Flickity React

Flickity component for React

Installation

  npm install flickity --save
  npm install react-flickity --save

Add loaders to webpack config and production files

module: {
    loaders: [
      {
        test: /flickity/,
        loader: 'imports?define=>false&this=>window'
      }
    ]
  }

Download and import flickity to your css

Example

var React = require('react')
var Flickity = require('react-flickity')

var flickityOptions = {
    initialIndex: 0,
    cellSelector: '.sliderBoxes',
    accessibility: true,
    pageDots: true,
    wrapAround: true,
    autoPlay: 3000 // default false
}

var Carousel = React.createClass({
    render: function () {
    return (
      <Flickity
        className={ 'carousel' } // default ''
        elementType={ 'div' } // default 'div'
        options={ flickityOptions } // takes flickity options {}
        disableImagesLoaded={ false } // default false
      >
        <div className="sliderBoxes"></div>
        <div className="sliderBoxes"></div>
        <div className="sliderBoxes"></div>
      </Flickity>
    );
  }
});

module.exports = Carousel;
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%