Giter Club home page Giter Club logo

dependencyfreecarousel's Introduction

Dependency-Free Carousel ๐ŸŽ 

This is a carousel React component built without any additional carousel library.
It supports swipe motion(mouse, touch), responsive images, indicator dots, navigation buttons, color customization and navigation using keyboard.

๐Ÿ”— Demo here

Goal 1. Render slides with data size handling

  • It maps out each element from the data object into a slides roll, and it shows one slide at a time in the viewport.
  • It requires you to set minimum and maximum number of slides to render the carousel with MIN_DATA_SIZE, MAX_DATA_SIZE.

Goal 2. Support swipe motion to navigate in any device

  • There are swipe handling functions to track the swipe motion cycle, handleSwipeStart, handleSwipeMove, handleSwipeEnd. These handlers take care of the mouse events and also the touch events on mobile devices.

  • When the dragged distance from swiping is meaningful(DRAG_THRESHOLD), it triggers the slides roll to move to the next, or the previous slide to show.

Goal 3. Make it accessible; Support navigation by keyboard

Goal 4. Optional Customization

  • You can choose whether you show indicator dots or not by setting indicatorDots prop.
  • You can choose whether you show navigation buttons or not by setting navigationButtons prop.
  • You can set the color of navigation arrows and marked dot by setting color prop to any color.

Available Scripts

In the project directory, run: yarn start. it runs the app in the development mode. Open http://localhost:3000 to view it in the browser.

dependencyfreecarousel's People

Contributors

gaonita avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.