Skip to content

jkusachi/react-flickity-component

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Flickity Component

Introduction:

A React.js Flickity component.

Install:

npm install react-flickity-component --save

Peer Dependencies:

  • Flickity
  • imagesLoaded

Development:

Build npm run build

Watch npm run dev

Assumptions!!!:

import Flickity from 'flickity';
import imagesloaded from 'imagesloaded';

window.Flickity = Flickity;
window.imagesloaded = imagesloaded;

so please run npm install --save flickity imagesloaded

Add the styles

Add the CSS to your project, however you do it (SCSS, etc...)

Usage:

import React from 'react';
import FlickityComponent from 'react-flickity-component';

var flickityOptions = {
    initialIndex: 2
}

export default function TestComponent() {
    return (
        <FlickityComponent
            className={'carousel'}
            elementType={'span'}
            options={flickityOptions}
        >
            <div className="items">
                <img src="/images/placeholder.png"/>
            </div>
            <div className="items">
                <img src="/images/placeholder.png"/>
            </div>
            <div className="items">
                <img src="/images/placeholder.png"/>
            </div>
        </FlickityComponent>
    );
}

Credits

Forked from theolampert/react-flickity-component

License Information:

Flickity may be used in commercial projects and applications with the one-time purchase of a commercial license. http://flickity.metafizzy.co/license.html

About

A React.js component for using @desandro's Flickity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 77.9%
  • CSS 22.1%